JqPlot series and naming conventions

I am trying to execute jqPlot but cannot figure out how to set the name for different series.

Currently, my code looks like this:

$(document).ready(function () { $.jqplot('chartdiv', [ [[201201, 10], [201202, 20], [201203, 30], [201204, 60], [201205, 40]], [[201201, 5], [201202, 10], [201203, 7], [201204, 8], [201205, 11]] ], { axes: { xaxis: { label: "Year/month", pad: 0 }, yaxis: { label: "Amount (Kr)" } }, legend: { show: true } }); }); 

It displays a diagram, but the series is called series 1 and next to 2. Is there a way I can control the naming of the series?

+8
javascript jquery jqplot
source share
1 answer

To have names for the series, you must set a β€œlabel” that is under the β€œseries”. See documentation here .

Sample code representing its use is available here.

+9
source share

All Articles