Skip to content

Stacked Treemap

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

df = pd.read_csv(
    "https://ipyvizzu.vizzuhq.com/0.17/assets/data/chart_types_eu_data_4.csv",
    dtype={"Year": str, "Timeseries": str},
)
data = Data()
data.add_df(df)

chart = Chart()
chart.animate(data)
  • move the Size channel's Dimension to the X-axis
  • move the Measure to the Y-axis
  • duplicate the Dimension in the Color channel onto the Y-axis
  • None the Label channel
chart.animate(
    Config(
        {
            "channels": {
                "color": "Country",
                "size": ["Year", "Value 2 (+)"],
                "label": "Year",
            }
        }
    )
)

chart.animate(
    Config(
        {
            "channels": {
                "x": "Year",
                "y": ["Country", "Value 2 (+)"],
                "size": None,
                "label": None,
            }
        }
    ),
    Style({"plot": {"marker": {"colorPalette": None}}}),
)

chart.feature("tooltip", True)