|
Display Y-axis labels in Kb,Mb for bits data values |
Posted by Mariia on Jun-02-2017 21:07 |
|
I am drawing a chart which is displaying traffic volume on server. The data is in bits.
Is it an easy way to display Y-axis labels in KB and MB, based on data changes?
I was able to manage the case when there are all data are over 1 MB(displayed labels as MB) or over 1KB, but less then 1MB(displayed all labels as KB). But I was not able to find easy way to display combinated labels(MB and KB).
For example, I have an data values such as: ["1046", "8743", "10754", "678943", "1345987", "1676453"]. And I want Y-axis labels to be displayed as :
1Kb, 100Kb, 500Kb, 1Mb, 1.5Mb (example is attached). Is it any way to do it with ChartDirector Line chart?
Thanks,
Mariia
|
Re: Display Y-axis labels in Kb,Mb for bits data values |
Posted by Peter Kwan on Jun-03-2017 05:30 |
|
Hi Marilia,
If the label positions are automatically generated by ChartDirector, the labels would be evenly spaced, so it would not be like the followings due to uneven spacing:
1Kb, 100Kb, 500Kb, 1Mb, 1.5Mb
Instead, it would be:
0, 500Kb, 1Mb, 1.5Mb
For the above case, personally, I think the labels 0.0M, 0.5M, 1.0M and 1.5M is still acceptable. There are advantages in using the same "unit" and similar number of digits for the labels. The labels 0K, 500K, 1000K, 1500K would also be acceptable.
If the labels are really 1Kb, 100Kb, 500Kb, 1Mb, 1.5Mb, they are non-evenly spaced and can only be generated by your own code (such as using Axis.addLabel). In this case, you can always use any label you like as the Axis.addLabel allows you to specify any label you like.
If you prefer to use the label positions automatically generated by ChartDirector, but use different "units", you can ask ChartDirector for the label positions, and then add your preferred label text at those positions. An example is like:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1432415960#N1432577039
Hope this can help.
Regards
Peter Kwan |
|