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.
This command gets the reference line object for a particular axis and specific identifier.
This command sets the value at which the reference line displays for the specified axis and identifier.
This command gets the ID of the label for the specified reference line.
This command gets the reference line object for a particular axis and specific identifier. This API returns null if the specified reference line does not exist.
This command creates a reference line for a particular axis and specified identifier.
This command returns the location of a reference line for a particular axis and specific identifier.
This command removes the specified reference line object.
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);
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");
Gets the reference line legend text IdentObj.
The following line hides the legend text for a reference line:
setDisplay(getReferenceLineLegendText(getY1Axis(),0),false)
WebFOCUS |