|
Converting to whole number |
Posted by raman on Dec-18-2015 08:13 |
|
Hi ,
I am raman .Looking for solution for 2 issues.
1.Converting the value into whole.
Eg: i have like 1.00, 2.00 ,3.00 etc..
I need to be like this as 1 ,2 , 3 etc..
2.Removing negative value ,
Eg; I have value like -1000 ,0 ,1000 etc
I need avoid this as 0,1000 etc..
Can anyone help me here.
Attaching graph for referrence.
Thank you
|
Re: Converting to whole number |
Posted by Peter Kwan on Dec-19-2015 03:35 |
|
Hi raman,
1. By default, for your labels, ChartDirector will use 1, 2, 3, not 1.00, 2.00, 3.00. If the
chart displays 1.00, 2.00, 3.00, is it possible your own code asks ChartDirector to use 2
decimal places for formatting? If this is the case, please remove that line of code so that
ChartDirector can use default formatting. If you are not sure where is the code that
causes the format to show 2 decimal places, is it possible to inform me the charting part
of your code?
2. If the axis scale is automatically determine by ChartDirector (and not specified by your
code), then ChartDirector will include negative numbers only if the chart include negative
numbers. Note that even -0.0000000000000000000000000000000001 is considered as a
negative number, even though it looks like 0 on the chart.
If the data are computed values, note that in computers, there may be floating point
rounding issues. Depending on which formula you are using, sometimes the computed
values are not exactly accurate, and a value supposed to be zero may be computed to
become a very small negative number. If this is the cause of the problem, you may need
to modify the computation code to adjust for the error (such as to change very small
numbers to 0) because passing the data to ChartDirector.
If you want the axis to start from 0, even though the chart contains negative values,
you can use Axis.setLinearScale to set the lower limit to 0. It is like (in C#/Java):
//lower limit 0, upper limit auto
c.yAxis().setLinearScale(0, Chart.NoValue);
Hope this can help.
Regards
Peter Kwan |
Re: Converting to whole number |
Posted by raman on Dec-22-2015 04:58 |
|
Thank you So much Peter."c.yAxis().setLinearScale" worked . |
|