"areaFixed"

With the trend attribute "areaFixed" you can fix a trend area to the current geometry.

Synopsis

setValue(string shape,"areaFixed", int area, bool fixed );

getValue(string shape,"areaFixed", int area, bool fixed );

shape.areaFixed(int area, bool fixed);

Parameter

Parameter Description
area Trend area. The index starts at 0.
fixed The area is fixed (TRUE).

Description

With the trend attribute "areaFixed" of a trend you can fix a trend area to the current geometry. Thus, a fixed time scale can be shown even when the areas are large enough for scrollbars to be needed and the time scale is currently invisible because of scrolling.

With the attribute, you can fix one area for a trend with several areas and then link all areas. Thus, several trend areas can be moved by using one time scale. You can also link curves for one area and display other curves for another fixed area. To link areas, use the attribute "linkAreas".

Example

This example sets the minimum size of the trend areas via the attribute "areaMinimumSize". If the sum of the minimal sizes of the areas is bigger than the available size of the trend, scroll bars are shown for the trend widget. The trend area 3 (index 2) is fixed.

main()
{
  TREND2.areaMinimumSize(0, 250);
  TREND2.areaMinimumSize(1, 250);
  TREND2.areaMinimumSize(2, 250);
  TREND2.areaFixed(2, true);
}
Abbildung 1. A trend with one fixed area( "ExampleDP_Result", at the bottom)

Example

The second example shows how trend areas are fixed and linked.

main()
{
  int timeArea = TREND1.numTrendAreas - 1;
//Number trend areas -1
  if ( this.toggleState )
//Status of a button (ON = enabled & OFF = disabled).
  {
    if ( !TREND1.areaFixed(timeArea) )
//If trend area is not fixed
    {
      TREND1.addTrendArea();
//Adds a new trend area to the trend
      timeArea++;
      TREND1.timeScaleVisibility(timeArea, true, SCALE_BOTTOM);
//Shows a time scale at the bottom of the trend
      TREND1.areaFixed(timeArea, true);
//The area is fixed
    }
    int num = TREND1.numTrendAreas;
//Number of trend areas

    for (int i = 0; i < num; i++)
//As long as i < number of trend areas
    {
      TREND1.linkAreas(0, i);
//link areas
      if ( i != (num - 1) )
        TREND1.timeScaleVisibility(i, false, SCALE_BOTTOM);
    }
  }
  else
  {
    TREND1.removeTrendArea(timeArea);
//Delete trend area
    int num = TREND1.numTrendAreas;

    for (int i = 0; i < num; i++)
    {
      TREND1.unlinkAreas(0, i);
//unlink areas
      TREND1.timeScaleVisibility(i, true, SCALE_BOTTOM);
    }
  }
}
Abbildung 2. Linked Trend areas

Assignment

Trend