Hello,
I am working with the 2D Column Infragistic graph where I have the graph coming like the image given below.
In the Y-axix we have the data here in millions .I want this to be like -1.5 to 3.0 in millions.I have tried various formatting styles here but the result is same.Then also tried <Data_Value:0'.'######>
This gave me the result with -1.5 00000 to 3.000000 .But this is not required.
Would any one please suggest me how to format the y-a xix data..
Hello Manaswini,
Maybe one possible approach is to handle ultraChart1_FillSceneGraph() event and modify your Text primitives with removing unnecessary part of the label of your Y axis. Please take a look at the code below:
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
foreach (Primitive pr in e.SceneGraph)
if (pr.GetType() == typeof(Text) )
string ss = ((Text)pr).GetTextString();
if (ss.Length >= 5)
ss = ss.Remove(3);
((Text)pr).SetTextString(ss);
}
Please let me know if you have any further questions.
Regards
Hello Georgi,
Thanks for your suggestion.
I have used the suggested the code but it is trimming all the texts .Here is the snapshot.
Have you any suggestion regarding this?
HelloManaswini,
Yes, it is true, because we need to extend our IF conditions and apply these changes only for the Text primitives of our Y axis, otherwise we will change the Text primitives on X axis, legend, titels and etc. Could you please take a look at the attached sample, one possible approach to achieve this behavior. In attached sample I modify only the lables on Y axis ( I use the same code with extend IF conditions and I change the lable`s color to Red for better visiblity).
Please let me know if you have any questions.
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. Please let me know if you have any questions.
Hello @Georgi,
I have used the sample code in my application but the graph comes like the graph posted in the 1st post.
Actually in the graph everything is in string format.May be that's why it comes like this.
Actually the data should come like 12.00 format removing the rest of the decimal points from it as it is in the x- axix data in the attached application
Could you please suggest me further.
Thanks
Please take a look, that in my scenario, I divide the points that I add to the series. I didn`t make any changes in the DataSet
BPLseries.Points.Add(new XYDataPoint((double)(table.Rows[i][0]), (double)table.Rows[i][1]/Coef, "", false));
If you have a time you could debug my sample and see that Dataset keep the original values, only the points in the series are divided with coefficient.
If you are able, please upload your sample here. I`ll be glad to research it. Please let me know if you have any questions.
Thank you a lot. It really works for Y-axix data formatting.
But it comes up with another issue.It is dividing in the actual dataset value but we need the actual value on the tool tip of bars. :(
Would you please suggest further to solve it.
Have you been able to resolve your issue ? Did you have a time to take a look at the new attached sample. Please let me know if you have any questions.
Maybe one other approach could be if you are using coefficient, which will divide your actual values from DataSet for your Y axis and then add these new values in your series. For example:
double Coef = 10000;
Please take a look at the attached sample for more details. Please let me know if you have any questions.