I am looking to display three series on the same canvas. The series are defined as follows:
rec1 = [0, 0, 150, 200, 0 ];
rec2 = [60, 120, 179, 240, 300];
rec3 = [50, 100, 150, 200, 250];
Below are the source codes I am using to draw these series.
$.jqplot("chart", [rec1, rec2, rec3], {
title: "",
axesDefaults: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
fontSize: '10pt'
}
},
seriesDefaults: {
rendererOptions: {
smooth: false
},
pointLabels: {
show: true,
ypadding: 10
},
showMarker: true,
lineWidth: 2
},
legend: {
show: true,
location: 'nw',
placement: "outside"
}
});
In rec1, any elements with a zero value should remain zero. However, I want to hide these zero-value-elements in rec1. Is there a way to achieve this? Setting rec1 to be:
rec1 = [undefined, undefined, 150, 200, undefined]
Will hide these undefined points, but it causes the point labels for 150 and 200 to appear at incorrect positions, as shown in the image. Appreciate any helpful guidance.