Back

Pie Chart - pie, one level, raised theme

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(
                {
                    name: 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"
                },
                slice: {
                    styleFunction: function (slice, data) {
                        slice.insideLabel.text = (slice.percent.toFixed()) + "%";
                        if (data.name) {
                            slice.label.text = data.name + " " + data.value + " units";
                        }
                    }
                },
                interaction: { resizing: { enabled: false } },
                pie: {
                    innerRadius: 0
                }
            }
        );
    }
    // 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
Kobe Bryant	27849149
Dwight Howard	19536360
Pau Gasol	19000000
Steve Nash	8900000
Metta World Peace	7258960
Steve Blake	4000000
Jordan Hill	3563600
Chris Duhon	3500000
Jodie Meeks	1500000
Earl Clark	1240000
Devin Ebanks	1054389
Darius Morris	962195
Antawn Jamison	854389
Robert Sacre	473604
Darius Johnson	200585
Download Data