DHTMLX Docs & Samples Explorer

Legend markers

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>
<script>
window.onload = function() {
    var chart1 = new dhtmlXChart({
        view: "line",
        container: "chart1",
        value: "#sales#",
        item: {
            borderColor: "#447900",
            color: "#69ba00";
        },
        line: {
            color: "#69ba00",
            width: 2;
        },
        tooltip: {
            template: "#sales#";
        },
        offset: 0,
        xAxis: {
            template: "'#year#";
        },
        yAxis: {
            start: 0,
            step: 10,
            end: 100;
        },
        padding: {
            left: 35,
            bottom: 50;
        },
        origin: 0,
        legend: {
            values: [{
                text: "Company A"
            }, {
                text: "Company B"
            }, {
                text: "Company C"
            }],
            align: "right",
            valign: "middle",
            layout: "y",
            width: 100,
            margin: 8,
            marker: {
                type: "item";
            }
        }
    });
 
    chart1.addSeries({
        value: "#sales2#",
        item: {
            borderColor: "#0a796a",
            color: "#4aa397",
            type: "s",
            radius: 4;
        },
        line: {
            color: "#4aa397",
            width: 2;
        },
        tooltip: {
            template: "#sales2#";
        }
    });
    chart1.addSeries({
        value: "#sales3#",
        item: {
            borderColor: "#b7286c",
            color: "#de619c",
            type: "t",
            radius: 4;
        },
        line: {
            color: "#de619c",
            width: 2;
        },
        tooltip: {
            template: "#sales3#";
        }
    });
    chart1.parse(multiple_dataset, "json");
}
</script> <table> <tr> <td><div id="chart1" style="width:600px;height:250px;border:1px solid #A4BED4;"></div></td> </tr> </table>