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
125
Drilldown application using xamChart Control
posted

Hi,

I want to use xamChart control for the Dashboard in my Winform application.

I have few questions with this control

1)How to use this control in Winform Application,i cann't able to add this control from rt.click toolbox and selecting choose item menu?

2)How to use DrillDown functionality with this control?Please provide some sample application.

 

Regards

Parents
  • 28496
    Suggested Answer
    Offline posted

    Lindsay said:
    1)How to use this control in Winform Application,i cann't able to add this control from rt.click toolbox and selecting choose item menu?

    since the XamChart is a WPF control and not a Windows Forms control, trying to use it in a WinForms app is a little complicated: http://msdn.microsoft.com/en-us/library/ms742215.aspx

    note that we also have a Windows Forms chart control available.

    Lindsay said:
    2)How to use DrillDown functionality with this control?Please provide some sample application.

    there is no special mechanism for drilldown, it is simply a matter of handling one of the click events (this can be on the series, chart control, or datapoint) and applying whatever changes you want at that time.  in most drilldown scenarios, this will involve changing the datasource.  the code will look something like this:

            private void XamChart_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
            {
                XamChart theChart = (XamChart)sender;
                HitTestArgs hit = theChart.HitTest(e);
                switch (hit.PointIndex)
                {
                    case 0:
                        theChart.Series.Clear();
                        theChart.Series.Add(this.GetSeries());
                        break;
                    case 1:
                        theChart.Series.Clear();
                        theChart.Series.Add(this.GetSeries());
                        break;
                    case 2:
                        theChart.Series.Clear();
                        theChart.Series.Add(this.GetSeries());
                        break;
                }
            }

Reply Children
No Data