IChartAxis.DisplaySelectedPoints

Syntax

DisplaySelectedPoints([FitToAll: Boolean = false]);

Parameters

FitToAll. Chart scale mode.

Description

The DisplaySelectedPoints method scales the chart so that all selected points are displayed.

Comments

The method is used to work with a chart, which category axis is scaled, that is, the IChart.InteractiveMode property is set to ChartInteractiveMode.Zoom, and the IChart.ZoomMode property is set to ChartZoomMode.AxisX.

Available values of the FitToAll parameter:

Example

Executing the example requires a form containing the ChartBox component with the ChartBox1 identifier and the UiChart component with the UiChart1 identifier that is a data source for ChartBox1. The UiChart1 component must contain two or more series, each series must contain more than 10 points.

Sub UserProc;
Var
    Chart: IChart;
    Series: IChartSeries;
    Serie: IChartSerie;
Begin
    // Get chart
    Chart := UiChart1.Chart;
    // Set scale mode for category axis
    Chart.InteractiveMode := ChartInteractiveMode.Zoom;
    Chart.ZoomMode := ChartZoomMode.AxisX;
    // Get chart series
    Series := Chart.Series;
    // Get the first series and select the second and fourth points
    Serie := Series.Item(0);
    Serie.SeriePoint(1).Selected := True;
    Serie.SeriePoint(3).Selected := True;
    // Get the second series and select the sixth and ninth points
    Serie := Series.Item(1);
    Serie.SeriePoint(5).Selected := True;
    Serie.SeriePoint(8).Selected := True;
    // Rebuild chart so that all selected points are displayed
    Chart.AxisX.DisplaySelectedPoints(True);
End Sub UserProc;

After executing the example the second and fourth points of the first series and the sixth and the ninth points of the second series are selected on the chart. The chart is scaled so that the selected points are maximally scaled.

See also:

IChartAxis