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 cannot really make any recommendations regarding the actual interval of the UltraChart control, but it is possible to set the range of the axes in the control manually. In order to do this, you need to set the RangeType property of your axes to “Custom” and then you can set the RangeMax and RangeMin properties to the numeric value of your choosing. The code for this, setting the maximum to 40 billion for both axes, would look like the following:
ultraChart1.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;ultraChart1.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;
ultraChart1.Axis.X.RangeMax = 40000000000;ultraChart1.Axis.Y.RangeMax = 40000000000;
This is yet another reason that I would highly recommend upgrading to a later version of the Infragistics for Windows Forms toolset so that you can use the UltraDataChart. The UltraDataChart has zoom and pan capabilities built-in so that you could zoom in to see the points that are plotted closer together.
Please let me know if you have any other questions or concerns on this matter.
Ok, thanks. Talking about the scatter chart, it is using default scaling and so the interval (40 billion) is internally managed by the control itself. Are there any other options available such that a better interval is used by the control? Any recommendation?
In order to attach a file to our forums, it needs to be less than 1MB in size. Generally, for an isolated sample, deleting the bin and obj folders for the project(s) will do this.
Regarding your sample project on OneDrive, I have been taking a look, and it appears that the plots that you are seeing are expected. The scatter chart is “bunching up” in the corner because both of your X and Y axes currently have an interval of 40 billion. A great majority of the X and Y values (or both) in your bound data source to this chart have values of around 2 billion or less. As such, they will show up closer to the connecting axes.
The same sort of thing is happening for your column charts. The reason you are not seeing the columns show up until you enlarge them is because the columns that would be plotted would be well less than 1 pixel tall, and as such, they won’t be plotted. For example, in your bottom-right chart, the scale goes from -10 to 90 with a crossing value of the Y-Axis at zero, but a great majority of your points are between negative 0.1 and positive 0.1. Compared to the maximum value of 90, a value of .01 for example would be plotted 1/9000th of the way to 90. These charts would have to be very large to be able to show that plot, as the rectangles would be quite a bit less than 1 pixel and as such, would not be plotted.
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:
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.
UltraChartBigNumberFormatCase.zip