Need help for Drill Down from a chart with click on the bar?

Sep 5, 2009 at 7:50 AM

Hello I'm a newbie in WPF and I like to use the chart control from WPF Toolkit. The cahrt control is used like that:

    Background="{StaticResource backgroundColorLightBlue}"
    BorderBrush="Black" BorderThickness="0"
    Title="{Binding Source={StaticResource Lang}, XPath=chartGroupDepth/title/@Header}"
        Title="{Binding Source={StaticResource Lang}, XPath=chartGroupDepth/titleColumn/@Header}"
        DependentValueBinding="{Binding DepthCount}" 
        IndependentValueBinding="{Binding DepthName}" 

Now I like to a the click event on the bar (DataPoint?) to drill down. But if I'm using the MouseLeftButtonDown method the sender
is always the ColumnSeries and there is not the "graph" bar i clicked on. How can I implement the "OnClick" for the single bar 
Each help I would appreciate much !!!
The result should be that I get back the "data" container I put in in the binding like it is with the 
method chartingToolkit:DataPointSeries.SelectionChanged="OnSelectionChanged">. But here the bar will be selected and still stay
selected. My goal is to open an datailed window (the original window still exist) and after closing I could not click anymore to 
the current "selected" bar. How could I delete the selection of that bar. In WinForms you just set a control.SelectedItem = -1, 
but in WPF?
I have an additonal request regarding the tooltip if I'm using the excellent code snippet my tooltip with the values disapears.
What do I need to do to get back the default behavior to see again my values?
            <Style TargetType="chartingToolkit:ColumnDataPoint">
                <Setter Property="Template">
                        <ControlTemplate TargetType="chartingToolkit:ColumnDataPoint">
                                    Fill="{TemplateBinding Background}"
                                        Text="{TemplateBinding FormattedDependentValue}"

Thanks for reading and I hope the questions are not so stupid. I'm lost and need urgently an idea ...
Sep 9, 2009 at 9:25 AM

I solved at least my Drill Down with the default setting I still investigate but from day to day it makes more fun to work with WPF.

Our solution we used now is:

<?xml version="1.0" encoding="utf-8"?>
    Title="{Binding Source={StaticResource Lang}, XPath=chartGroupDepth/titleColumn/@Header}"
    DependentValueBinding="{Binding Count}"
    IndependentValueBinding="{Binding Name}"


The code behinde is:

private void GroupDepthChartOnSelectionChanged(object sender, SelectionChangedEventArgs e)
    if (e.AddedItems.Count >= 1)
        if (null != this.chart.SelectedItem)
            // Do something with the SelectedItemObject ...
            this.chartGroupDepth.SelectedItem = null;

private void EnterInAColumnSeries(object sender, MouseEventArgs e)
    this.Cursor = Cursors.Hand;

private void LeaveAColumnSeries(object sender, MouseEventArgs e)
    this.Cursor = null;            

We found it easier if the mouse go over the bar that a cursor cahnge indecate that you can click on it for drill down ...
Have a nice day
Mike aka Shrek1910