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
410
Changing the highligt color on 3D pie chart
posted

Hello,

 I am trying to change the highlight color on the pieces of a 3d pie chart.  I see where you can change the color to a certian color but what I am trying to do is change the color of the pie piece to a light color of the pie pieces color.  Similar to what Control.Light.Light would to a control.

 The other thing that has me a little stumped is I would like to do is only highlight the pie chart piece on a mouse click and not a hover. 

Any help is great.

 Thanks,

Mike

  • 28496
    Verified Answer
    Offline posted

    i recommend just setting the chart's Tooltips.Display property to Never and doing the highlighting in code in a ChartDataClicked event handler.  here's one solution which does this using a CustomLinear ColorModel and replacing the appropriate color whenever a slice is clicked:

    using Infragistics.UltraChart.Shared.Events;

    using Infragistics.UltraChart.Shared.Styles; 

    private Color[ _Colors = new Color[ { Color.Red, Color.Green, Color.Blue };
    private Color[ _LightColors = new Color[ { Color.Pink, Color.Lime, Color.SkyBlue };
    private void Form1_Load(object sender, EventArgs e)
    {
        this.ultraChart1.ColorModel.ModelStyle = ColorModels.CustomLinear;
        this.ultraChart1.ColorModel.CustomPalette = this._Colors;
    }

    private void ultraChart1_ChartDataClicked(object sender, ChartDataEventArgs e)
    {
        Color[ newColors = new Color[this._Colors.Length];
        this._Colors.CopyTo(newColors, 0);
        newColors[e.DataRow] = this._LightColors[e.DataRow];
        this.ultraChart1.ColorModel.CustomPalette = newColors;
    }