Skip to content

Stacked Area to Line

Info - How to setup Chart
import pandas as pd
from ipyvizzu import Chart, Data, Config, Style

data_frame = pd.read_csv(
    "https://ipyvizzu.vizzuhq.com/0.14/assets/data/tutorial.csv",
    dtype={"Year": str, "Timeseries": str},
)
data = Data()
data.add_data_frame(data_frame)

chart = Chart()
chart.animate(data)
chart.animate(
    Config(
        {
            "channels": {
                "x": "Timeseries",
                "y": {
                    "set": ["Values 1", "Categ. Parent"],
                    "range": {"max": "400"},
                },
                "label": "Values 1",
                "color": "Categ. Parent",
            },
            "title": "Stacked Area Chart",
            "geometry": "area",
        }
    )
)

chart.animate(
    Config(
        {
            "channels": {"y": "Values 1"},
            "title": "Line Chart",
            "geometry": "line",
        }
    )
)

chart.animate(Config({"channels": {"y": {"range": {"max": "auto"}}}}))