Skip to content

This example shows how to create a custom series model and change the selection color for series points.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/wpf-chart-customize-the-appearance-of-selected-series-points

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chart for WPF - How to Customize the Appearance of Selected Series Points

This example shows how to create a custom series model and change the selection color for series points.

Chart

  1. Create an object that represents a custom model of a particular series CustomBar2DModel and assign it to the Model property of a corresponding series type (BarSeries2D.Model).

  2. Create the System.Windows.Controls.ControlTemplate object which contains a Border element to create your own custom model.

  3. Assign this template to the PointTemplate property of a custom series model (CustomBar2DModel.PointTemplate).

  4. Create the IsSelectedConverter. For this, create the IsSelectedToBrushConverter class inherited from IValueConverter. Then, implement Convert  and ConvertBack methods. The Convert method returns black if the IsSelected value is true; otherwise, red.

  5. Bind the Border.Background property to the SeriesPointPresentationData.IsSelected property with IsSelectedToBrushConverter from the static resource. Set the ChartControl.SelectionMode property to Multiple to enable chart selection. 

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

This example shows how to create a custom series model and change the selection color for series points.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •