Back

Pie Chart - pie, one level, 3d theme, no labels, info popup

LA Lakers salaries season 2012/2013

Documentation Open in JSFiddle
Start Free Trial Purchase

HTML

HTML
<script src="https://cdn.zoomcharts-cloud.com/1/nightly/zoomcharts.js"></script>

<div id="demo"></div>

CSS

CSS
//No CSS for this example 

JavaScript

JavaScript

    function success(data) {
        var r = { subvalues: [] };
        for (var k in data.subvalues) {
            r.subvalues.push(
                {
                    style: { label: { text: data.subvalues[k][0] } },
                    value: data.subvalues[k][1]
                }
            );
        }
        t = new PieChart(
            settings = {
                theme: PieChart.themes.raised,
                container: document.getElementById("demo"),
                data: {
                    preloaded: r,
                    sortField: "value"
                },
                interaction: { resizing: { enabled: false } },
                area: { style: { image: "/dvsl/doc/pie-chart/images/lakers-bg.jpg" } },
                pie: { innerRadius: 0.8 },
                labels: {
                    enabled: false
                },
                info: {
                    contentsFunction: function (chart, sliceData, slice, callback) {
                        if (sliceData.value) {
                            return sliceData.label.text + " " + sliceData.value + "$";
                        }
                    }
                }
            }
        );
    }
    // using a custom library to load CSV data
    loadCSV("/dvsl/data/pie-chart/la-lakers-salaries-2012-13.csv", null, [
            { type: "string", name: "name" },
            { type: "decimal", name: "salary" }
    ], "\t", function (data) {
        success(data);
    });

Data

Data
//Data too large to output
Download Data