<!-- WebDataRocks Dark Theme -->
<link rel="stylesheet" type="text/css" href="https://cdn.webdatarocks.com/latest/webdatarocks.min.css" />
<!-- WebDataRocks Scripts -->
<script src="https://cdn.webdatarocks.com/latest/webdatarocks.toolbar.min.js"></script>
<script src="https://cdn.webdatarocks.com/latest/webdatarocks.js"></script>
<!-- WebDataRocks Connector for FusionCharts -->
<script src="https://cdn.webdatarocks.com/_codepen/webdatarocks.fusioncharts.js"></script>
<!-- FusionCharts Script -->
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<!-- FusionCharts Theme -->
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fusion.js"></script>

<div id="wdr-component"></div>
<div id="fusionchartContainer" style="margin-top:1px;"></div>
var pivot = new WebDataRocks({
    container: "#wdr-component",
    toolbar: true,
    height: 380,
    width: "100%",
    report: {
        dataSource: {
            "dataSourceType": "csv",
            "filename": "https://cdn.webdatarocks.com/data/data.csv"
        },
        "slice": {
            "rows": [{
                "uniqueName": "Country"
            }],
            "columns": [{
                    "uniqueName": "Category"
                },
                {
                    "uniqueName": "Measures"
                }
            ],
            "measures": [{
                "uniqueName": "Price",
                "aggregation": "sum"
            }]
        }
    },
    reportcomplete: function() {
        pivot.off("reportcomplete");
        createFusionChart();
    }
});

function createFusionChart() {
    var chart = new FusionCharts({
        "type": "stackedcolumn2d",
        "renderAt": "fusionchartContainer",
        "width": "100%",
        "height": 350
    });

    pivot.fusioncharts.getData({
        type: chart.chartType()
    }, function(data) {
        chart.setJSONData(data);
        chart.setChartAttribute("theme", "fusion"); // apply the FusionCharts theme
        chart.render();
    }, function(data) {
        chart.setJSONData(data);
        chart.setChartAttribute("theme", "fusion");
    });
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.