Skip to content

Bubble to Radial

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.csv",
    dtype={"Year": str, "Timeseries": str},
)
data = Data()
data.add_df(df)

chart = Chart()
chart.animate(data)

This Vizzu animation consist of 2 steps (animates):

1st:

  • move the Dimension from the Label channel to the X-axis
  • move the Measure from the Size channel to the X-axis
  • add the other Dimension to the Y-axis
  • set the Y-axis range min to make empty circle in the center
  • switch the Geometry from Circle to Rectangle

2nd:

  • remove the other Dimension from the X-axis
  • add the Measure to the Label channel too
chart.animate(
    Config(
        {
            "channels": {
                "color": "Joy factors",
                "label": "Country_code",
                "size": ["Country_code", "Value 2 (+)"],
            },
            "geometry": "circle",
        }
    )
)

chart.animate(
    Config(
        {
            "channels": {
                "y": {"set": "Joy factors", "range": {"min": "-30%"}},
                "x": ["Country_code", "Value 2 (+)"],
                "label": None,
                "size": None,
            },
            "geometry": "rectangle",
            "coordSystem": "polar",
            "sort": "byValue",
        }
    )
)

chart.animate(
    Config({"channels": {"x": "Value 2 (+)", "label": "Value 2 (+)"}})
)