Skip to content

Bubble to Coxcomb

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.7/dist/vizzu.min.js'
import {
    data
} from 'https://lib.vizzuhq.com/0.7/assets/data/chart_types_eu.js'

let chart = new Vizzu('myVizzu')

chart.initializing

chart.animate({
    data
})

This Vizzu animation consist of 2 steps (animates):

1st:

  • move the Dimension from the Label channel to the Y-axis
  • move the Measure from the Size channel to the Y-axis
  • add the other Dimension to the X-axis
  • 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": {
            "x": "Joy factors",
            "y": [
                "Country_code",
                "Value 2 (+)"
            ],
            "label": null,
            "size": null
        },
        "geometry": "rectangle",
        "coordSystem": "polar"
    },
    style: {
        "plot": {
            "marker": {
                "rectangleSpacing": "0em"
            }
        }
    }
});

chart.animate({
    config: {
        "channels": {
            "y": "Value 2 (+)",
            "label": "Value 2 (+)"
        }
    }
});