ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Problem on Stack Bar additional values showing
Posted by Mark Jagunap on Jan-31-2012 12:45
Attachments:
Hi Peter,

I got a problem with the stack bar chart it seems that it was picking another value (see
image attached. The one encircled with a yellow pen.)

I checked the scripts it looks ok to me.

I'll wait for your response.

Thanks,

Mark
error.JPG

  Re: Problem on Stack Bar additional values showing
Posted by Peter Kwan on Jan-31-2012 23:34
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