Reference Lines

In this section:

Reference:

Reference line support is implemented for various chart types excluding pie and pie bar. There can be a total of 3 reference lines for each axis (Y1, Y2, and X1). Each reference line has color and thickness. There can be text associated with each reference line, which can appear in a reference line legend. Each reference line, in addition to being assigned an axis and location, is also assigned an identifier.


Top of page

x
Reference: APIs Related to Reference Lines

Top of page

x
Reference: Properties Supported by Reference Lines


Example: Creating a Reference LIne With a Label

The following code turns on a reference line for the Y1 axis, sets the value at which the line displays to 20,000, creates a label for the reference line, and turns on the display of the label:

setDisplay(getReferenceLineY1(0),true);
setReferenceLineValueY1(0,20000.0);
setLineWidth(getReferenceLineY1(0),2);
setTextString(getReferenceLineTextY1(0),"Salary at 20K");
setDisplay(getReferenceLineTextY1(0),true);



Example: Creating a Reference Line

The following example creates a Y1 Axis reference line at the y = 50 with the color red and a width of 3.

setReferenceLine(getY1Axis(),0, 50.0);
setLineWidth(getReferenceLine(getY1Axis(),0),3);
setFillColor(getReferenceLine(getY1Axis(),0), new Color(255,0,0)); 

The following line hides a reference line:

setDisplay(getReferenceLine(getY1Axis(),0),false);

The following line shows how to associate text with the reference line:

setTextString(getReferenceLine(getY1Axis(),50),"label");

Top of page

x
APIs Related to the Reference Line Legend

The following line hides the legend text for a reference line:

setDisplay(getReferenceLineLegendText(getY1Axis(),0),false) 

WebFOCUS