javascript - jqPlot and naming series -


i'm trying out jqplot, can't figure out how set name of different series.

currently, code looks 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 renders diagram, series named series 1 , series 2. there way can control naming of series?

to have names series must set 'label' under 'series'. please see here documentation.

example code presenting use available here.


Comments