I don't really know why it is not working for me. I have a 3D HeatMap chart and I would like the x and y axis label to have only 2 decimal places. My data looks like this: 10.000000, 20.000000.
Unfortunately, when I use the below, the data gets changed to 1.00, 2.00. I have no idea why this could happen.
ultraChart1.Axis.X.Labels.ItemFormatString =
"<DATA_VALUE:###.00>" ;
ultraChart1.Axis.Y.Labels.ItemFormatString =
"<DATA_VALUE:###.00>";
Please help.
Hello,
Your formatting string is incorrect: try this one:
Hope this helps.
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc
Ok, I can see it now. This issue here is that you have string labels, not data values. You can try using IRenderLabel interface:
this.ultraChart1.Axis.X.Labels.ItemFormatString = "<MY_VALUE>";
Hashtable MyLabelHashTable = new Hashtable();
MyLabelHashTable.Add("MY_VALUE", new MyLabelRenderer());
this.ultraChart1.LabelHash = MyLabelHashTable;
…
public class MyLabelRenderer : IRenderLabel
{
public string ToString(Hashtable context)
string label = (string)context["ITEM_LABEL"];
double value = Convert.ToDouble(label);
return value.ToString("0.00##");
}
Sorry, I meant I don't have problem with Y axis. I only have problem in X axis.
I have no problem with x and z axis. I seem to have problem in Y axis. I wonder if there's something to do with how I assemble the data source. Attached is the data source I set in the chart. If I understand correctly, the chart uses the columns for Y-axis labels. Is that correct? Maybe there is something I have not done it right?
I’ve been trying:
this.ultraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.HeatMapChart3D;
this.ultraChart1.DataSource = DemoTable.BoxChartData;
this.ultraChart1.DataBind();
this.ultraChart1.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:0.00##>";
And it seems ok. I’m not really sure what the issue with your code is.