NVD3 line Chart

by Sergio Crisostomo

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.v3.min.js"></script>
<script src="http://nvd3.org/assets/js/nv.d3.js"></script>
<link rel="stylesheet" href="http://nvd3.org/assets/css/nv.d3.css">
<div id="idDiv">
    <svg></svg>
</div>

CSS

#chart svg {
    height: 200px;
}

JavaScript

var svg = d3.select('svg');

var nvd3Charts = function() {

    var myColors = ["#06A705", "#F7A818", "#00BFDD", "#FF702A", "#DA3610",
        "#80CDC2", "#A6D969", "#D9EF8B", "#FFFF99", "#F7EC37", "#F46D43",
        "#E08215", "#D73026", "#A12235", "#8C510A", "#14514B", "#4D9220",
        "#542688", "#4575B4", "#74ACD1", "#B8E1DE", "#FEE0B6", "#FDB863",
        "#C51B7D", "#DE77AE", "#EDD3F2"
    ];

    d3.scale.myColors = function() {
        return d3.scale.ordinal().range(myColors);
    };

    startChart9 = function() {
        //Donut chart 
        nv.addGraph(function() {
            var chart = nv.models.pieChart().x(function(d) {
                    return d.label;
                }).y(function(d) {
                    return d.value;
                }).showLabels(true) //Display pie labels
                .labelThreshold(.05) //Configure the minimum slice size for labels to show up
                .labelType("percent") //Configure what type of data to show in the label. Can be "key", "value" or "percent"
                .donut(true) //Turn on Donut mode. Makes pie chart look tasty!
                .donutRatio(0.30) //Configure how big you want the donut hole size to be.   

            .color(d3.scale.myColors().range());

            d3.select("#idDiv svg").datum(exampleData()).transition().duration(350).call(chart);
            chart.pie.dispatch.on("elementClick", function(pie) {
                alert(JSON.stringify(pie, '\n', ' '))
            });
            return chart;

        });

        //.on('click', function (i, row) {
        //    alert(row.label, row.value);

        //Pie chart example data. Note how there is only a single array of key-value pairs.

        function exampleData() {
            return [{
                "label": "Enviado",
                "value": 56.456875654566
            }, {
                "label": "Pendente",
                "value": 56.456875654566
            }];
        }

    };

    function...