Skip to content

100% Stacked Column

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

let chart = new Vizzu('myVizzu')

chart.initializing

chart.animate({
    data_4
})
  • move the Dimension from the Y-axis to the X-axis, behind the one there (group)
  • set the Align parameter from 'stretch' to 'min'
chart.animate({
    config: {
        "channels": {
            "x": "Year",
            "y": {
                "set": [
                    "Country",
                    "Value 2 (+)"
                ],
                "align": "stretch"
            },
            "color": "Country"
        }
    }
});

chart.animate({
    config: {
        "channels": {
            "x": [
                "Year",
                "Country"
            ],
            "y": {
                "set": "Value 2 (+)",
                "align": "none"
            }
        }
    }
});

chart.feature('tooltip', true);