Skip to content

Donut

Info - How to setup Vizzu

In HTML, create a placeholder element that will contain the rendered chart.

<html>
 <body>
  <div id="myVizzu">
  </div>
 </body>
</html>

In JavaScript, initialize and configure the chart:

import Vizzu from 'https://cdn.jsdelivr.net/npm/vizzu@0.10/dist/vizzu.min.js'
import {
    data_8
} from 'https://lib.vizzuhq.com/0.10/assets/data/chart_types_eu.js'

let chart = new Vizzu('myVizzu')

chart.initializing

chart.animate({
    data_8
})

This Vizzu animation consist of 2 steps (animates):

1st:

  • move the Dimension from X-axis to the Y-axis
  • add a new Dimension to the X-axis
  • remove the Measure from the label channel

2nd:

  • move the Measure from X to Y-axis
chart.animate({
    config: {
        "channels": {
            "x": [
                "Country",
                "Value 2 (+)"
            ],
            "y": {
                "range": {
                    "min": "-200%"
                }
            },
            "color": "Country",
            "label": "Value 2 (+)"
        },
        "coordSystem": "polar"
    }
});

chart.animate({
    config: {
        "channels": {
            "x": [
                "Year",
                "Value 2 (+)"
            ],
            "y": {
                "set": "Country",
                "range": {
                    "min": "-30%"
                }
            },
            "label": null
        }
    }
});

chart.animate({
    config: {
        "channels": {
            "x": "Year",
            "y": {
                "set": [
                    "Country",
                    "Value 2 (+)"
                ],
                "range": {
                    "min": "-30%"
                }
            }
        }
    },
    style: {
        "plot": {
            "marker": {
                "rectangleSpacing": "0.1em"
            }
        }
    }
});

chart.feature('tooltip', true);