I try to implement IRenderLabel Interface for Column Chart but it didnt work (LabelRenderer ist not call):
public class LabelRenderer : IRenderLabel { /// <summary> /// </summary> /// <param name="context"></param> /// <returns></returns> public string ToString(Hashtable context) { string resultString = string.Empty; double dataValue = (double)context["DATA_VALUE"]; int dataValueModulo = 0; if(dataValue >= 1000000000 ) { dataValueModulo =(int)dataValue % 1000000000; resultString = dataValueModulo.ToString() + "Mrd."; } return resultString; } }
---------------------
ToRenderColumnChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:n0>"; Hashtable LabelHashTable = new Hashtable(); LabelHashTable.Add("DATA_VALUE", new LabelRenderer()); ToRenderColumnChart.LabelHash = LabelHashTable;
Please Help me, asp.
Thank you very much
Thanks Max :)
You won't be able to use any of the predefined label tokens, such as DATA_VALUE, ITEM_LABEL, etc.You have to create a custom token, like MY_DATA_VALUE and you'll see IRenderLabel.ToString being called. Your context hash table will already have data_value and other predefined tokens.