I'm trying to create custom axis labels on a combination UltraChart. I have the top X axis labels on an hour-by-hour time interval and I want the bottom X axis labels to follow the same interval, but display custom data. The data I want to be displayed is going to be derived from the same data used to create the line chart, how could I go about manipulating the data and displaying the results in the bottom X axis labels?
Any help would be greatly appreciated.
Thanks!
Try implementing IRenderLabel, if you want to replace existing x axis labels with custom text. For example,
Hashtable labelHash = new Hashtable();labelHash.Add("CUSTOM", new MyLabelRenderer());ultraChart1.LabelHash = labelHash;xAxis.Labels.ItemFormatString = "<CUSTOM>";
public class MyLabelRenderer : IRenderLabel{ public string ToString(Hashtable context) { string label = (string)context["ITEM_LABEL"]; int row = (int)context["DATA_ROW"]; int col = (int)context["DATA_COLUMN"]; //use row, col, current label's text or other info inside the context to get the axis label. //the string returned here will replace the current label. return label; }}