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
195
Pie Chart Legend
posted

Hi,

 

I would like to know if we can trap the legend click event ?

also is it possible to crontrol the color of the pie chart are? 

 

 

Thanks

 

Parents
No Data
Reply
  • 26458
    Offline posted

    By default the legend is not interactive. Try using ChartDrawItem event to set up additional properties on the legend primitives to make them clickable:

    private void ultraChart1_ChartDrawItem(object sender, Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e){
       if (e.Primitive.Path != null && e.Primitive.Path.IndexOf("Legend") != -1){
          e.Primitive.Caps |=
    PCaps.HitTest | PCaps.Tooltip;
         
    if (e.Primitive.Row == -1 && e.Primitive.Column == -1){
             e.Primitive.Row = e.Primitive.Column = 0;
          }
       e.Primitive.Chart =
    this.ultraChart1.ChartType;
       }
    }

    After you do this, ChartDataClicked will fire when you click the legend

    The colors of the pie chart can be controlled in a number of ways. You can refer to the following help link for more information about using the chart's different color models:
    http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/Chart_Appearance.html

Children