IChartHint.CustomFormat

Syntax

CustomFormat: String;

Description

The CustomFormat property determines a custom format of numeric values of tooltips on the chart.

Comments

Available formats:

To determine a format of data label view on the chart, use IChartHint.StringFormat.

Example

Executing the example requires a form containing the components:

  1. ChartBox with the ChartBox1 identifier.

  2. UiChart with the UiChart1 identifier. It is required to set the number of points and series for UiChart1. The UiChart1 component is a data source for ChartBox1. To plot a chart, create the event handlers OnGetDataValue and OnGetSerieName.

Sub Userproc;
Var
    Chart: IChart;
    Hint: IChartHint;
    Color: IGxColor;
    Font: IGxFont;
Begin
    // Get chart
    Chart := UiChart1.Chart;
    // Get chart tooltips
    Hint := chart.HintFormat;
    // Enable tooltips
    Chart.UseSignatureHint := True;
    // Change tooltip background color
    Hint.BackgroundInfo.Color := New GxColor.CreateRGB(1200120);
    // Create a new color
    Color := New GxColor.CreateRGB(127127127);
    // Disable ability to take color from indicator for tooltip border
    Hint.UseIndicatorColorForBorder := False;
    // Apply new color for tooltip contour
    Hint.BorderPen := New GxPen.CreateSolid(Color);
    // Set default format
    Hint.CustomFormat := "0,0000";
    // Create a new font
    Font := New GxFont.Create("Arial"5);
    // Apply new font for tooltips
    Hint.Font := Font;
    //Change color font
    Hint.FontColor := Color;
    // Change horizontal position of label on tooltip
    Hint.HorizontalAlignment := ChartHorizontalAlignment.Left;
    // Change format of tooltip displaying for stacked value
    Hint.StringFormat := "%Part";
    // Refresh chart
    Chart.Refresh;
End Sub Userproc;

After executing the example, pointing the cursor on chart bars displays tooltips of the specified format.

See also:

IChartHint