New to Telerik UI for WPF? Start a free 30-day trial
2. Subscribe to the ItemClick event of the ChartArea and get a list of all PointMarks in the ChartArea using the ChildrenOfType
Highlight PointMark On Click
Updated on Sep 24, 2025
It is common scenario that you would like to select a single PointMark of Line Series for example. Since InteractivityScope.Item (for more information see Interactivity Effects topic) is not supported for series that do not render separate items (Line, Spline, Area, Range, and all their stacked versions) this help topic will demonstrate how to select single Line's PointMark and customise it.
1. Create Line Chart Series. The following code snippet demonstrates LineSeries created using Manual Series Mappings.
C#
public MainPage() //MainWindow() for WPF
{
InitializeComponent();
Random r = new Random();
List<ItemData> chartData = new List<ItemData>();
for (int i = 0; i < 20; i++)
{
chartData.Add(new ItemData(i, r.Next(0, 100)));
}
this.radChart.ItemsSource = chartData;
this.SetUpMappings();
}
private void SetUpMappings()
{
SeriesMapping mapping = new SeriesMapping();
mapping.SeriesDefinition = new LineSeriesDefinition()
{
ShowItemToolTips = true,
ShowItemLabels = false
};
mapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
mapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));
this.radChart.SeriesMappings.Add(mapping);
}
public class ItemData
{
public double XValue { get; set; }
public double YValue { get; set; }
public ItemData(double xValue, double yValue)
{
this.XValue = xValue;
this.YValue = yValue;
}
}
2. Subscribe to the ItemClick event of the ChartArea and get a list of all PointMarks in the ChartArea using the ChildrenOfType extension method. The next step is to figure out which PointMark is selected. Find the SingleOrDefault PointMark from the eventargs (e.DataPoint) which matches the datacontext of a pointmark in the collection of pointmarks:
C#
void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
{
this.ClearPointMarkSelectedState();
var pointMarks =
radChart.DefaultView.ChartArea.ChildrenOfType<PointMark>().ToList<PointMark>();
this.selectedPointMark =
pointMarks.Where(x => x.DataContext == e.DataPoint).SingleOrDefault();
this.SetPointMarkSelectedState();
}3. The methods SetPointMarkSelectedState() and ClearPointMarkSelectedState() define what should be done with the selected PointMark (in this case the selected one's MarkerShape is set to Triangle and the Fill to Red) and how to return to it's default state when another one is selected (Circle MarkerShape and White Fill):
C#
private void SetPointMarkSelectedState()
{
if (this.selectedPointMark == null)
return;
this.selectedPointMark.Fill = new SolidColorBrush(Colors.Red);
this.selectedPointMark.Shape = MarkerShape.Triangle;
this.selectedPointMark.Size = 12;
}
private void ClearPointMarkSelectedState()
{
if (this.selectedPointMark == null)
return;
this.selectedPointMark.Fill = new SolidColorBrush(Colors.White);
this.selectedPointMark.Shape = MarkerShape.Circle;
}The snapshot below shows the result:
