I am trying to create a line chart that has a constant line and a dynamically generated line. At the moment when I do not pass any values into the array, jqplot will not draw anything for my dynamic line.
I would like jqplot to have a default value of 1 if the dynamic line is empty or has only say 1 out of 5 values, for example if the array generates [] it would like it to generate [[1],[1],[1],[1],[1]] and if the array generates [[4],[3],[],[],[]] I would like it to be able to put a 1 in the empty array e.g. [[4],[3],[1],[1],[1]]
any help on this would be really appreciated.
here is some of the code I have so far;
var values = $('input:radio:checked').map(function () {
return this.value
}).get();
var line1 =[[1,values[0],1], [2,values[1],1], [3,values[2],1], [4,values[3],1],[5,values[4],1]];
var line2 =[[1,4],[2,5],[3,4],[4,5],[5,5]];
$.jqplot('chartdiv', [line2,line1],
{
Thank you in advance.