Bubble to Radial
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.9/dist/vizzu.min.js'
import {
data
} from 'https://lib.vizzuhq.com/0.9/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 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": null,
"size": null
},
"geometry": "rectangle",
"coordSystem": "polar",
"sort": "byValue"
}
});
chart.animate({
config: {
"channels": {
"x": "Value 2 (+)",
"label": "Value 2 (+)"
}
}
});