JavaScript
var chart = new CanvasJS.Chart("chartContainer",
{
data: [
{
type: "line",
indexLabelFormatter: function (e) { return e.dataPoint.label },
dataPoints: [
{ x: 0, y: 2, label: null},
{ x: 100, y: 2 , label: null },
{ x: 100, y: 3, label: null },
{ x: 300, y: 3, label:"Hello #1"},
{ x: 300, y: 2, label: null },
{ x: 400, y: 2, label: null },
]
},
{
type: "line",
indexLabelFormatter: function (e) { return e.dataPoint.label },
dataPoints: [
{ x: 0, y: 0, label: null},
{ x: 100, y: 0 , label: null },
{ x: 100, y: 1, label: null },
{ x: 300, y: 1, label:"Hello #2"},
{ x: 300, y: 0, label: null },
{ x: 400, y: 0, label: null },
]
},
{
type: "line",
indexLabelFormatter: function (e) { return e.dataPoint.label },
dataPoints: [
{ x: 0, y: -2, label: null, indexLabelPlacement: "inside"},
{ x: 100, y: -2 , label: null },
{ x: 100, y: -1, label: null },
{ x: 300, y: -1, label:"Hello #3"},
{ x: 300, y: -2, label: null },
{ x: 400, y: -2, label: null },
]
}
]
});
chart.render();