DHTMLX Docs & Samples Explorer

Series

Source
<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
    <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
    <script src="../common/testdata.js"></script>
 
<div id="chart1" style="width:900px;height:250px;border:1px solid #A4BED4;"></div>
 
<script>
var barChart1 = new dhtmlXChart({
    view: "bar",
    container: "chart1",
    value: "#sales#",
    color: "#58dccd",
    gradient: "rising",
    tooltip: {
        template: "#sales#";
    },
    width: 20,
    tooltip: {
        template: "#sales#";
    },
    xAxis: {
        template: "'#year#";
    },
    yAxis: {
        start: 0,
        step: 10,
        end: 100;
    },
    legend: {
        values: [{
            text: "A",
            color: "#58dccd"
        }, {
            text: "B",
            color: "#a7ee70"
        }, {
            text: "Expected",
            color: "#36abee",
            markerType: "item"
        }],
        valign: "middle",
        align: "right",
        width: 90,
        layout: "y";
    }
});
barChart1.addSeries({
    value: "#sales2#",
    color: "#a7ee70",
    tooltip: {
        template: "#sales2#";
    }
});
barChart1.addSeries({
    //offset:0,
    view: "line",
    item: {
        radius: 0;
    },
    line: {
        color: "#36abee";
    },
    value: "#sales3#",
    tooltip: {
        template: "#sales3#";
    }
});
barChart1.parse(multiple_dataset, "json");
</script>