Hi Mark,
Do you mean the chart is suppose to only have NL1 to NL6, but there seems to be an extra set of values beyond NL6?
The most likely reason for the last zero values is that your data do have those values. In other words, the length of your data array is 7, so there are 7 values. If you have not used the last array position, PHP will treat it as 0 in numeric context. Similary, if your x-axis label array has 7 elements, but you do not use the last element, PHP will treat it as an empty string (so you do not see any label).
To confirm if the above is the cause of the problem, you may use:
$c->xAxis->setTitle("My array length = " . count($myDataArray));
The above will display the length of your data array in the x-axis title. If it shows 7, it confirms you have an extra element in your array. To solve the problem, please make sure your array does not include the extra element.
Hope this can help.
Regards
Peter Kwan |