I have a radcartesianchart with the items data source in my viewmodel.
I'm trying to get the chart to respond visually to a point selection. When I set a breakpoint on the RadChart1_SelectionChanged event and count the selected points its obviously adding points to the selection series. I'm using the selection changed event handler exactly as in the ChartView samples. I may just be mixing up point templates with pallettes as I don't really get which is applied where. Thanks for any help.
I'm trying to get the chart to respond visually to a point selection. When I set a breakpoint on the RadChart1_SelectionChanged event and count the selected points its obviously adding points to the selection series. I'm using the selection changed event handler exactly as in the ChartView samples. I may just be mixing up point templates with pallettes as I don't really get which is applied where. Thanks for any help.
<
telerik:RadCartesianChart
Grid.Row
=
"1"
HorizontalAlignment
=
"Left"
Margin
=
"41,22,0,0"
Name
=
"radCartesianChart1"
VerticalAlignment
=
"Top"
Height
=
"343"
Width
=
"769"
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartSelectionBehavior
DataPointSelectionMode
=
"Multiple"
HitTestMargin
=
"10"
SelectionChanged
=
"RadChart1_SelectionChanged"
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:RadCartesianChart.SelectionPalette
>
<
telerik:ChartPalette
>
<
telerik:ChartPalette.SeriesEntries
>
<
telerik:PaletteEntryCollection
SeriesFamily
=
"Scatter"
>
<
telerik:PaletteEntry
Fill
=
"Red"
/>
</
telerik:PaletteEntryCollection
>
</
telerik:ChartPalette.SeriesEntries
>
</
telerik:ChartPalette
>
</
telerik:RadCartesianChart.SelectionPalette
>
<
telerik:ScatterPointSeries
ItemsSource
=
"{Binding Source={StaticResource myContext}, Path=ChangeStatsCollection}"
XValueBinding
=
"PolyID"
YValueBinding
=
"Acreage"
BorderBrush
=
"Black"
AllowSelect
=
"True"
>
<
telerik:ScatterPointSeries.PointTemplate
>
<
DataTemplate
>
<
Ellipse
Width
=
"5"
Height
=
"5"
Fill
=
"Green"
/>
</
DataTemplate
>
</
telerik:ScatterPointSeries.PointTemplate
>
</
telerik:ScatterPointSeries
>
</
telerik:RadCartesianChart
>
private
void
RadChart1_SelectionChanged(
object
sender, ChartSelectionChangedEventArgs e)
{
if
(e.AddedPoints.Count == 0)
return
;
// Get the data point.
var dataPoint = e.AddedPoints[0];
int
sPoints = radCartesianChart1.SelectedPoints.Count;
// Get the series.
ScatterPointSeries series = dataPoint.Presenter
as
ScatterPointSeries;
}