Note: The data used in this example is available here. You can read more about the available types of data in the Adding data chapter.

In [1]:
import pandas as pd
from ipyvizzu import Chart, Data, Config, Style

data_frame = pd.read_csv(
    "../../data/music_industry_history_1.csv", dtype={"Year": str, "Timeseries": str}
)
data = Data()
data.add_data_frame(data_frame)

chart = Chart()
chart.animate(data)

chart.animate(
    data.filter(
        """
  record.Format == 'DVD' ||
  record.Format == 'Other' ||
  record.Format == 'Tapes' ||
  record.Format == 'Download' ||
  record.Format == 'Streaming' ||
  record.Format == 'Cassette' ||
  record.Format == 'Vinyl' ||
  record.Format == 'CD'
  """
    ),
    Config.verticalStream(
        {
            "x": "Revenue [m$]",
            "y": "Year",
            "stackedBy": "Format",
            "title": "Vertical Stream Graph",
        }
    ),
    Style(
        {
            "plot": {
                "paddingLeft": "1.2em",
                "yAxis": {"label": {"paddingRight": "0.8em"}},
                "xAxis": {
                    "title": {"paddingTop": "2.4em"},
                    "label": {"paddingTop": "0.8em"},
                    "interlacing": {"color": "#ffffff00"},
                },
            }
        }
    ),
)

Back to the Examples ----- Back to the Table of contents