PresentationSource

View as Markdown

Definition

Provides a reference to the base window in which the chart is rendered. PresentationSource can be used when converting application pixels to/from device pixels via the helper methods in the ChartingExtensions class.

Property Value

A PresentationSource object representing the base window in which the chart is rendered.

Syntax

ChartControl.PresentationSource

Examples

1int devicePixelX;
2protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
3{
4 // Obtain the device-pixel coordinate corresponding to an application-pixel X value of 500
5 devicePixelX = ChartingExtensions.ConvertToHorizontalPixels(500, ChartControl.PresentationSource);
6}