|
Stopping a line graph short |
Posted by Joel on Dec-03-2013 23:10 |
|
Hi there,
I have a graph showing the months on the x-axis. In the instance of 2013 data, December
will currently have nothing. I find that when I pass blank into the structure that I'm sending
to the chart, even as blank it bottoms the report out to 0 for December.
I can't seem to figure out a way to both show that December is there in the graph, yet
stop the line in November until Dec has actual data.
Thanks,
Joel. |
Re: Stopping a line graph short |
Posted by Peter Kwan on Dec-03-2013 23:51 |
|
Hi Joel,
If you do not want to have anything for December, the easiest method is not to pass anything to ChartDirector for December. For example, you have 12 labels for the x-axis for Jan to Dec, but your data array can contain only 11 elements. In this case, nothing will display for Dec.
If you must use a data array with 12 elements, even if you only have 11 data points, please fill the 12th element with NoValue. The exact syntax depends on your programming language. It can be called Chart.NoValue (for Java, C#, VB.NET), NoValue, cd.NoValue, $perlchartdir::NoValue, etc.. The sample code "Missing Data Points" demonstrates the use of NoValue.
For "blank", in most programming languages (eg. VB, C#, Java), numeric data arrays are automatically set to 0 when it is allocated. Some programming languages, such as C++, arrays are automatically set to random numbers when they are allocated. So if you do not use an array element, it is not blank, but assume the default value. In many programming languages, it is not possible to put "blanK" in a numeric array element. In programming langauges that do allow "blank", it is normally equivalent to 0 in numeric context. In almost all the cases, this would mean the data value become 0 in numeric context. So instead of "blank", NoValue should be used, or the array element should not exist at all (use an array containing only 11 elements).
Hope this can help.
Regards
Peter Kwan |
Re: Stopping a line graph short |
Posted by Joel on Dec-04-2013 00:13 |
|
Thanks for the reply Peter this is helpful.
I'm writing in Coldfusion and in this case putting the data into a structure and passing it,
which wouldn't be adjusting the value from blank to 0, however now that you mention it I
suspect them I pass from the CF Struct into a query object it must be doing that.
This should be everything I need though.
Thanks again,
Joel. |
|