Hi,
I am working with UltraChart and I have large number of values (in billions). Do we have any built-in functionality in chart (scatter chart to be specific) such that it displays axis labels with millions or billion with number instead of showing large numbers? Please refer below snapshot for details:
So, instead of showing axis label as 160,000,000,000, I want 160B as axis label.
Also, chart scale do no adjust itself properly and most of data is displayed close to one point e.g. close to 0 in snapshot. Please note that I am using chart's default scaling. Any help please?
Thanks in anticipation.
Asim
Hello Asim,
In order to achieve this requirement, I would recommend that you use the UltraDataChart instead of the UltraChart control. The UltraDataChart has a setting built-in that will do this formatting for you, in that its numeric axes have a bool property called AbbreviateLargeNumbers. When set to true, a number like 1,000,000,000 will be shown as 1B.
Another reason that I recommend doing this with the UltraDataChart over the UltraChart is that I do not believe there is a way to do this with the UltraChart. The UltraChart’s label formats happen using the ItemFormatString of the corresponding Labels property of the Axis, as described in this documentation article. If you have points in your chart where the X-Axis needs to show both 1 million values and 1 billion values, you won’t be able to format the labels separately for 1M or 1B, for example. The UltraDataChart does this with a single property setting.
I am attaching a sample project to demonstrate the UltraDataChart achieving this requirement.
Regarding the clustering of your points, I put together a fully linear sample with both the UltraDataChart and the UltraChart, and I have found that this is likely a precision-issue. For example, in the sample project I am sending you, if you remove the cast of the integer “i” in the ViewModel’s “for” loop to a long, you will run into precision issues with that operation that cause the points to plot all over the place. Note, this is on the side of the multiplication operation, not the chart, and is not a bug with the UltraDataChart or UltraChart as this will happen with both controls. However, if you cast it, the points should plot normally.
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
UltraDataChartLargeNumberDemo.zip
Hi Andrew,
Thanks for your prompt response. I am going through the demo but meanwhile can you please help whether replacing ultraChart with ultraDataChart can also help in below scenario where most of columns are not displayed until we zoom chart:
Please note that there are many columns that are not displayed by default.
Thanks,
Regarding the clustering of points, I am binding chart with a DataTable (C#) and the Column's data type is Decimal: {Name = "Decimal" FullName = "System.Decimal"}. So, please let me know if we need to change something here to fix it.
Also, I am using version 13.1.20131.1001 of Infragistics controls and UltraDataChart is not available in it. When was UltraDataChart introduced in Win Forms controls?
Please help.
I am attaching the other sample project that I had created using the UltraChart, now modified to use a decimal column in the DataTable and a Column chart. If you change the chart type in the sample to be a Scatter chart, all will work normally.
I also cannot seem to reproduce the behavior where not all of the UltraChart columns are showing until you zoom the chart. In the attached sample, I am using version 13.1.20131.1001. Would it be possible for you to please modify the sample project and send it back or provide an isolated one of your own that shows this behavior that you are seeing?
If you are using version 13.1, the UltraDataChart is not available, as this control became available in version 14.2.
Please let me know if you have any other questions or concerns on this matter.
UltraChartBigNumberFormatCase.zip
Thanks for your support. I am able to reproduce all the points and tried sharing with you the updated solution but then attaching zip file did't work for me. So, I have placed updated solution at OneDrive.
In the updated solution, I am reading data from a CSV (placed under Debug) and you just need to update the path to Bin/Debug folder as per your development environment.
I tried downloading solution and it worked fine but please do let me know if you face any issues while solution downloading from OneDrive. Please do share if there is a way to attach zip file here.
The updated output would be like: