IChart.DisplayMode

Syntax

DisplayMode: ChartDisplayMode;

Description

The DisplayMode property determines a chart display mode.

Comments

The chart display mode depends on the chart type.

Example

Executing the example requires a form containing the components:

Add a link to the Chart system assembly.

Sub Form_FormOnShow(Sender: Object; Args: IEventArgs);
Var
    Chart: IChart;
    Serie: IChartSerieBase;
Begin
    //Set the number of series points
    UiChart1.PointCount := 5;
    
//Set the number of chart series

    UiChart1.SerieCount := 15;
    //Set chart type
    UiChart1.Style := ChartStyle.Mixed;
    //Set chart display mode
    UiChart1.DisplayMode := ChartDisplayMode.ModeManhattan3D;
    //Set 3D chart
    UiChart1.DisplayVolume3D := True;
    Chart := UiChart1.Chart;
    Chart.DisplayMode := ChartDisplayMode.ModeManhattan3D;
    //Set displaying of Z axis
    Chart.DisplayZAxis := True;
    //Select Z axis on chart
    Chart.AxisZ.Selected := True;
    //Get chart series
    Serie := Chart.Series.DefaultSerie;
    //Enable displaying of data labels
    Serie.LabelsEnabled := True;

End Sub Form_FormOnShow;

//Set chart plotting event
{ OnGetDataValue }
Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
Begin
    Args.Result := True;
    //Set the number of points and chart series
    Args.Value := Args.PointIndex + Args.SerieIndex + 5;
End Sub UiChart1OnGetDataValue;

//Set chart group creation event
{ OnGetGroupCount }
Sub UiChart1OnGetGroupCount(Sender: Object; Args: IUiChartGroupCountEventArgs);
Begin
   //Set the number of chart groups
    Args.Result := 5;
    Debug.WriteLine("OnGetGroupCount: " + Args.Result.ToString);
End Sub UiChart1OnGetGroupCount;

//Set event for assigning names to chart groups
{ OnGetGroupName }
Sub UiChart1OnGetGroupName(Sender: Object; Args: IUiChartGroupNameEventArgs);
Begin
   //Assign names to chart groups
    Args.Result := "GroupName " + Args.GroupIndex.ToString;
    Debug.WriteLine("OnGetGroupName: " + Args.GroupIndex.ToString);
End Sub UiChart1OnGetGroupName;

//Set event for assigning indexes to chart parent series
{ OnGetParentSerieIndex }
Sub UiChart1OnGetParentSerieIndex(Sender: Object; Args: IUiChartParentSerieIndexEventArgs);
Begin
    If Args.SerieIndex < 5 Then
       Args.Result := -1;
    End If;
   //Assign indexes to chart parent series
    Select Case Args.SerieIndex
        Case 36912: Args.Result := 0;
        Case 471013: Args.Result := 1;
        Case 581114: Args.Result := 2;
    End Select;
End Sub UiChart1OnGetParentSerieIndex;

//Set event for assigning indexes to chart series groups
{ OnGetSerieGroupIndex }
Sub UiChart1OnGetSerieGroupIndex(Sender: Object; Args: IUiChartSerieGroupIndexEventArgs);
Begin
   //Assign indexes to chart series groups
    Select Case Args.SerieIndex //5 groups
        Case 012: Args.Result := 0;
        Case 345: Args.Result := 1;
        Case 678: Args.Result := 2;
        Case 91011: Args.Result := 3;
        Case 121314: Args.Result := 4;
    End Select;
End Sub UiChart1OnGetSerieGroupIndex;

//Set event for assigning names to chart series groups
{ OnGetSerieGroupName }
Sub UiChart1OnGetSerieGroupName(Sender: Object; Args: IUiChartSerieGroupNameEventArgs);
Begin
   //Assign names to chart series groups
    Args.Result := "SerieGroupName " + Args.SerieIndex.ToString;
    Debug.WriteLine("OnGetSerieGroupName: " + Args.SerieIndex.ToString);
End Sub UiChart1OnGetSerieGroupName;

//Set event for assigning names to chart series
{ OnGetSerieName }
Sub UiChart1OnGetSerieName(Sender: Object; Args: IUiChartSerieNameEventArgs);
    Begin
   //Assign names to chart series
    Args.Result := "Serie " + Args.SerieIndex.ToString;
    Debug.WriteLine("OnGetSerieName: " + Args.SerieIndex.ToString);
End Sub UiChart1OnGetSerieName;

//Set event for assigning names to chart points
{ OnGetPointName }
Sub UiChart1OnGetPointName(Sender: Object; Args: IUiChartPointNameEventArgs);
Begin
   //Assign names to chart points
    Args.Result := "Point " + Args.PointIndex.ToString;
    Debug.WriteLine("OnGetPointName: " + Args.PointIndex.ToString);
End Sub UiChart1OnGetPointName;

//Set event for using relative series
{ OnGetRelativeSerieEnabled }
Sub UiChart1OnGetRelativeSerieEnabled(Sender: Object; Args: IUiChartRelativeSerieEnabledEventArgs);
Begin
   //Use relative series
    Args.Result := True;
End Sub UiChart1OnGetRelativeSerieEnabled;

After opening the form a 3D histogram with selected Z axis is rendered in the ChartBox component. The chart will contain:

The console window displays parameters of occurring events.

See also:

IChart