def get_widget(self) -> AltairChart:
"""
Return the scientific chart.
Returns:
The scientific chart.
"""
data = pd.DataFrame({"a": list("CCCDDDEEE"), "b": [2, 7, 4, 1, 2, 6, 8, 4, 7]})
spec = alt.Chart(data).mark_point().encode(x="a", y="b")
chart = AltairChart(title=self.title)
chart.set_data(spec)
return chart
class SciChart(AltairChart):
"""
Scientific chart with Altair.
"""
#: The title of the chart.
title = "Scientific Proofiness"
def load(self) -> None:
"""
Load the chart data.
"""
data = pd.DataFrame({"a": list("CCCDDDEEE"), "b": [2, 7, 4, 1, 2, 6, 8, 4, 10]})
spec = alt.Chart(data).mark_point().encode(x="a", y="b")
self.set_data(spec)