Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
How can I change all values from x-axis after drawing the curve (the curve must not change)?
posted

Hello,
I use the UltraChart (version 10.3.20103.1) with x- and y-axis.
The curve is drawn.
But now I must change the values from the x-axis. The curve must not change!
For example one of the values from the x-axis show 2,3. The new value is 2300.

I want change all values from x-axis (every value * 1000).
How can I overwrite the old value 2,3 after drawing the curve (the curve must not change)?


Thanks
Alexander

Parents
No Data
Reply
  • 26458
    Offline posted

    Sounds like you just want to change the x axis labels. You should implement IRenderLabel in a way that it multiplies each existing label's value by 1000.

    Hashtable labelHash = new Hashtable();
    labelHash.Add("CUSTOM", new MyLabelRenderer());
    ultraChart1.LabelHash = labelHash;
    ultraChart1.Axis.X.Labels.ItemFormatString = "<CUSTOM>";

    public class MyLabelRenderer : IRenderLabel
    {
        public string ToString(Hashtable context)
        {
            double labelValue = (double)context["DATA_VALUE"];
            return (labelValue * 1000).ToString();
        }
    }

Children
No Data