IChartDateAxisSettings.Max

Syntax

Max: DateTime;

Description

The Max property determines a maximum value on the dates axis.

Comments

The property is available and can be saved only for the X axis. The Max property is taken into account if the conditions are satisfied:

Example

Executing the example requires that the repository contains a regular report with the REGULAR_REPORT_AXISTYPE identifier. This report must contain only line chart with five series.
Add links to the Chart, Metabase, Report, Tab system assemblies.

Sub Userproc;
Var
    mb: IMetaBase;
    regrep: IPrxReport;
    chart: IChart;
    sheet: IPrxSheet;
    table: ITabSheet;
    objects: ITabObjects;
    axis1: IChartAxis;
    settings: IChartDateAxisSettings;
Begin
    // Open a regular report for edit
    mb := MetabaseClass.Active;
    regrep := mb.ItemById("Regular_Report_AxisType").Edit As IPrxReport;
    // Get chart from regular report
    sheet := regrep.Activesheet;
    table := sheet.Table;
    objects := table.Objects;
    chart := objects.Item(0).Extension As IChart;
    // Get X axis
    axis1 := chart.AxisX;
    // Present X axis with labels as dates
    axis1.AxisType := ChartAxisType.DateAxis;
    // Edit dates axis
    settings := axis1.DateAxisSettings;
    // Cancel automatic substitution of maximum and minimum values
    axis1.AutoMin := False;
    axis1.AutoMax := False;
    // Set minimum value of dates axis
    settings.Min := DateTime.Parse("02.03.2014");
    // Set maximum value of dates axis
    settings.Max := DateTime.Parse("04.05.2014");
    // Set displaying by months on dates axis
    settings.BaseUnit := ChartDateAxisUnit.Month;
    // Set the point of dates axis, in which it is crossed by the main value axis
    settings.CrossAxisPositionValue := DateTime.Parse("04.04.2014");
    //Set the dates axis point, with which major tick marks start
    settings.MajorTickStartAt := DateTime.Parse("01.04.2014");
    // Set major tick mark interval
    settings.MajorTickUnitInterval := 3;
    // Set minor tick mark interval
    settings.MinorTickUnitInterval := 1;
    // Set measurement units of major tick marks
    settings.MajorTickUnit := ChartDateAxisUnit.Month;
    // Set measurement units of minor tick marks
    settings.MinorTickUnit := ChartDateAxisUnit.Days;
    // Set aggregation method by the average of dates axis elements
    settings.CategoryPointCollapse := DateCategoryPointCollapseType.Total;
    // Save changes
    (regrep As IMetabaseObject).Save;
End Sub UserProc;

After executing the example:

  1. The X axis becomes the dates axis.

  2. The minimum and maximum values of the dates axis are set.

  3. Data on the dates axis is displayed by months.

  4. The dates axis is intersected with the Y axis in the set point.

  5. Major tick marks start with the set point on the dates axis.

  6. The major tick mark interval on the dates axis is changed.

  7. The minor tick mark interval on the dates axis is changed.

  8. Months are used as measurement units for major tick marks on the dates axis.

  9. Days are used as measurement units for minor tick marks on the dates axis.

  10. The Sum aggregation method is used, and daily data is summed for the monthly frequency.

See also:

IChartDateAxisSettings