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.
You can try:
this.ultraChart1.Axis.X.Labels.ItemFormatString = <DATA_VALUE:0.00##>";
Unfortunately, this is not working for me. Any other suggestion? It keeps dividing my value by 10 when I use the above.
Sorry about the confusion! I think it's not really dividing by 10. It's jut once I change the format, instead of showing me the data, it should be column #. For example: My data is 10, 20,30,40,50. When I change it to
this
.ultraChart1.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:###,###,###,##0.0000>"; or your suggestion:
this.ultraChart1.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:0.00##>"; or
My x-axis become 0.0000, 1.0000, 2.0000....etc.
Is there a setting which I need to set in order to use my data as x-axis while formatting to 4 decimal places? 10.0000.
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.
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?
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.