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
860
Series MouseDoubleClick event
posted

Hello

I followed this guide to create a stacked chart with an OlapXAxis: http://help.infragistics.com/Help/Doc/WPF/2014.1/CLR4.0/html/xamDataChart_Customizing_Series_When_Used_With_Multi-Dimensional_Data_(OLAP_Data)_(xamDataChart).html

I subscribed to the MouseDoubleClick event, in where I want to get the clicked series. I am able to find the StackedColumnSeries, but not the exact sub-series (StackedColumnSeries has as Series collection). What I need is to get the same text the tooltip shows, to use in a drilldown.  

Do you know if that is possible?

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello logimatic,

    In order to get the exact sub-series from the XamDataChart.MouseDoubleClick event, I would recommend that you utilize the e.OriginalSource property, where e is the event arguments of your event. If you double click on one of the columns of your StackedColumnSeries, this should return the Rectangle element that makes up those columns. The data context of this Rectangle will be an element of the type Infragistics.Controls.Charts.DataContext. This DataContext element has a Series property that can return the ColumnFragment that makes up your sub-series in this case.

    Unfortunately, it does not appear that the values can really be publically attained from the ColumnFragment in this case, and so I would recommend delving into the private API of the ColumnFragment, using reflection to get the value of its ValueColumn property, and getting the "Values" property from the value of the ValueColumn. This should return a List<double>.

    It so happens that the index minus 1 of the Rectangles on the drawing canvas corresponds to the indices of this List<double> retrieved from the ValueColumn. You can retrieve this Canvas from the RootCanvas property of the ColumnFragment mentioned above and use it's Children.IndexOf method to find the index of the Rectangle e.OriginalSource that you had double-clicked. Doing this will allow you to get the value that the Rectangle represents, and using the code from our website, it appears that the ColumnFragment's Title will be your actual underlying value member path. Assuming you are using ShowDefaultTooltip = true on your StackedFragmentSeries elements, this should be all you need to get the tooltip that shows on each of these columns.

    I have attached a sample project to demonstrate the above. I hope this helps.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XamDataChartOlapStackedSeriesCase.zip
Children