Skip to content

Chart settings

You can change the behaviour of the chart with the constructor arguments and the chart properties detailed below.

Constructor arguments

Chart size

The size of the chart can be changed with width and height constructor arguments.

Info

width and height constructor arguments are optional, the default values are 800px and 480px. You can set them to any valid cssText value.

from ipyvizzu import Chart


chart = Chart(width="100%", height="500px")

Display behavior

There are multiple options for the logic of where and how the chart is displayed within the notebook and this behavior can be changed with the display constructor argument.

Info

display constructor argument is optional, the default value is DisplayTarget.ACTUAL.

Note

Not all options work in all environments, check the Environments chapter for more details.

Actual

actual

Chart is relocated and displayed after each cell that has been run. This is set by default or if display is set to DisplayTarget.ACTUAL.

from ipyvizzu import Chart, DisplayTarget


chart = Chart(display=DisplayTarget.ACTUAL)

Begin

begin

Chart is displayed after the cell with the chart constructor if display is set to DisplayTarget.BEGIN.

from ipyvizzu import Chart, DisplayTarget


chart = Chart(display=DisplayTarget.BEGIN)

End

end

If display is set to DisplayTarget.END, then in case one cell is excuted, the chart will be displayed after the cell. If multiple cells are run at once, the chart appears after the last cell set to run.

from ipyvizzu import Chart, DisplayTarget


chart = Chart(display=DisplayTarget.END)

Tip

By combining the above display options with the store function you can replay the original animation when you replay a cell. Another way to replay animations is to use our new extension ipyvizzu-story that enables you to build, present and share animated data stories in data science notebooks with a very similar syntax to ipyvizzu's.

Info

DisplayTarget.ACTUAL, DisplayTarget.BEGIN and DisplayTarget.END use IPython.display.display_javascript function.

Manual

Chart is displayed only when a display function is called if display is set to DisplayTarget.MANUAL.

Note

Even though it runs in more environments, the disadvantage of using MANUAL DisplayTarget is that the chart cannot be modified after calling a display function, without all the cells modifying the chart being rerun.

One of the display functions is the _repr_html_ method which is supported in most environments.

from ipyvizzu import Chart, DisplayTarget

chart = Chart(display=DisplayTarget.MANUAL)

# ...

chart

The other display function is the show method.

from ipyvizzu import Chart, DisplayTarget


chart = Chart(display=DisplayTarget.MANUAL)

# ...

chart.show()

Info

DisplayTarget.MANUAL with the show method uses IPython.display.display_javascript function.

Vizzu library

ipyvizzu requires and automatically downloads the 0.9/">Vizzu JavaScript/C++ library from jsDelivr CDN, but you can also use a self-hosted version.

Info

vizzu constructor argument is optional, the default value is Chart.VIZZU

Install Vizzu via npm:

npm install vizzu

After it is hosted on a server, you can use that url.

from ipyvizzu import Chart


chart = Chart(vizzu="<url>/vizzu.min.js")

Properties

Analytics

The usage statistics feature in ipyvizzu allows aggregate usage data collection using Plausible's algorithm. Enabling this feature helps us follow the progress and overall trends of our library, allowing us to focus our resources effectively and better serve our users.

We do not track, collect, or store any personal data or personally identifiable information. All data is isolated to a single day, a single site, and a single device only.

Usage statistics feature is optional, and by default, it is enabled (default value: True). Users can choose to opt-out if they prefer not to participate in data collection. Please note that even when this feature is enabled, publishing anything made with ipyvizzu remains GDPR compatible.

To disable usage statistics feature, set analytics property to False.

from ipyvizzu import Chart


chart = Chart()
chart.analytics = False

Scroll into view

When the scroll into view feature is turned on, ipyvizzu is able to automatically scroll to the chart being animated to view in the browser.

If manual scrolling is detected while auto-scrolling, ipyvizzu will stop auto-scroll until the notebook is replayed again.

Info

Scroll into view feature is optional, the default value is False .

Note

Scroll into view feature does not work in all environments, check the Environments chapter for more details.

To enable scroll into view feature, set scroll_into_view property to True.

from ipyvizzu import Chart


chart = Chart()
chart.scroll_into_view = True