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
65
Polar chart - rotate angle labels
posted

Hi,

 Is it possible to rotate angle labels counter-clockwise in polar chart, i.e. i want angle '0' on the top of the chart,

'90' on the right side, '180' at the bottom, and finally '270' on the left. If it is possible, how can i do it?

 

Thanks

Parents
No Data
Reply
  • 28496
    Offline posted

    you can't configure the chart to work this way through properties, but you can use IRenderLabel to change the text values of these labels:

                Hashtable labelRenderers = new Hashtable();
                labelRenderers.Add("CUSTOM_X", new PolarLabelRenderer());
                this.ultraChart1.LabelHash = labelRenderers;
                this.ultraChart1.Axis.X.Labels.ItemFormatString = "<CUSTOM_X>";

            internal class PolarLabelRenderer : IRenderLabel
            {
                string IRenderLabel.ToString(Hashtable context)
                {
                    double dataValue = Convert.ToDouble(context["DATA_VALUE"]);
                    dataValue += 90.0;
                    while (dataValue >= 360.0)
                    {
                        dataValue -= 360.0;
                    }
                    while (dataValue < 0.0)
                    {
                        dataValue += 360.0;
                    }
                    return dataValue.ToString("0");
                }
            }

Children