You can use scale markers to emphasize data items that are above or below a certain level, or emphasize data items in a certain range.
There are two types of scale markers. The first type is a line scale marker, which is a horizontal or vertical line drawn over the graph at a certain index along the scale. The second type is a range scale marker, which appears as a highlighted area behind the graph, between a maximum and minimum index along the bottom or side scales.
The image below shows a line scale marker (the red line), and two range scale markers (the red and green areas behind the graph).
To add a scale marker in PCScript, you should use the graph. AddScaleMarker() method. The first parameter of this method is the position of the scale that you want to add the scale to. These names are pre-set, and are as follows:
value | Main value scale. |
---|---|
svalue | Secondary value Scale |
x | X Scale |
y | Y Scale |
y2 | Secondary y scale |
time | Time scale |
The next parameter should be the scale marker type (range or line). The third parameter will be the low value of the range or the width of the line, depending on your scale marker type. The fourth parameter will be the high value of the range or the index of the line. The final parameter that you pass will be the color of the scale marker.
For example, to create the green area in the example image at the beginning of this section, you would use the following command.
graph.addScaleMarker(value,range,0,50,99eeaa)
If you don't know what the maximum or minimum value in your graph is, but want to use those values in your range, you can use the scaleMax and scaleMin entities instead. For example, the previous line of code could also be:
graph.addScaleMarker(value,range,scaleMin,50,99eeaa)
To create the red line in the same image, you would add this command.
graph.addScaleMarker(value,line,1,25,cc0000)
To add a scale marker in PopChart XML, add a ScaleMarker subelement to your Graph element. For example, to create the green area in the example image at the beginning of this section, you would add the following subelement.
<ScaleMarker Position="Value" Type="Range" Low="0" High="50" Color="#99eeaa" />
To create the red line in the same image, you would add this element.
<ScaleMarker Position="Value" Type="Line" Value="25" Color="#cc0000" />