Risers and Markers

Topics:

The risers and markers in a graph are initially determined by the graph type that is selected with the GraphType property. For example, GraphType 17 selects a vertical bar graph and the risers are drawn in the graph as vertical bars that are auto-shaded and imaged with a 2.5D effect by default. GraphType 54 selects a horizontal line graph in which risers are drawn as lines that are auto-shaded and imaged with a 2.5D effect by default.

2.5D line graph

You can use properties and methods to change how risers and markers are imaged in the graph. For more information about risers and markers in pie and stock graphs, see Pie Graph Properties and Methods and Stock Graph Properties and Methods.

Riser and Marker Properties

These properties control risers and markers in a graph:

  • ConnectLineMarkers (true/false). In line graphs where a 2.5D effect is not applied to the graph, the line risers are displayed as markers. Use this property to enable (true)/disable (false) the display of a line that connects the markers.
  • ConnectScatterMarkers (true/false). In a scatter graph, use this property to enable (true)/disable (false) the display of connecting lines between markers.
  • CubeSquareRisers (true/false). Use this if you want the risers/markers in a graph to always be square regardless of the shape and size of a 3D cube (for example).
  • DataLineThickness (1...100). For a 2.5D effect graph, this property defines the thickness (in pixels) of the fake 3D line.
  • DisplayBarAsPictograph (true/false). When a texture file has been loaded using setTextureURL(), you can use this property to enable the texture file image on bar risers.
  • MarkerDisplay (true/false). When lines are drawn between markers in a line or scatter graph, use this property to remove the markers from the graph and only display the connecting lines.
  • MarkerSizeDefault (0...100). Use this property to define the default size of markers in a 2D graph. See the get/setMarkerSize methods if you want to change the size of markers.
  • ReverseGroups (true/false), ReverseSeries (true/false), SeriesAreRows (true/false). These properties can be used to control how data is assigned to risers and markers in a graph.
  • Riser3DThicknessY (0...100), RiserBarGroupSpacing (0...100), RiserWidth (0...100). These properties can be used to control the size of bar risers in 3D and 2D graphs.
  • RiserBorderMode (0...2). Determines when riser borders are drawn (always, never, or only for small data sets (fewer than 900 risers)).
  • ScaleFromZero (true/false). In applications where the data range can include negative numbers, this property determines whether the risers will be drawn pointing up and down from a zero line or whether all risers will draw straight up from the bottom of the graph.
  • SeriesDefaultBorderColor(color), SeriesDefaultTransparentBorderColor (true/false), UseSeriesBorderDefaults (true/false). When UseSeriesBorderDefaults is enabled (true), riser borders will be drawn with the color defined with the SeriesDefaultBorderColor property if SeriesDefaultTransparentBorderColor is false. If SeriesDefaultTransparentBorderColor is true and UseSeriesBorderDefault is enabled, transparent borders are drawn around riser edges.

Riser and Marker Methods

In addition to the riser-specific properties, you can use these methods to get/set riser and marker attributes:

  • get/setMarkerShape(); Get/set the shape of markers in a series.
  • get/setMarkerSize(); Get/set the size of markers in a series or series and group.
  • get/setSeriesType(); Get/set the type (bar, area, or marker) of a series of risers.

You can use the setMarkerShape() method to set the shape of markers in a graph. Select from the following predefined shapes:

Marker Shape Number

Description

Image

1

Square

2

Circle

3

Diamond

4

Plus

5

Triangle Down

6

Triangle UP

7

Pirate Plus

8

Triangle Right

9

Triangle Left

10

House

11

Hexagon

12

Fat X

13

Five Star

14

Six Star

15

Hourglass

16

Sideways Hourglass

17

Horizontal Line

18

Vertical Line

19

Area

20

CirclePlus

21

CircleMinus

You can use the setSeriesType() method to assign a riser type to individual series. This method allows you to use different types of risers for series in a graph. For example, series one could use bar risers, series two could use line markers, and series three could use area risers.

When you use these methods, you may supply the object ID of a riser or marker as an input parameter to identify the object to which the attribute is applied. If a riser or marker is not specified, the attribute is retrieved from or assigned to the first item in the selection list. If the object ID does not identify a riser or marker object or the first item in the selection list is not a riser or marker, a set operation will apply the attribute to the object but it will not have any effect on the appearance of the graph.

Exceptional Risers

You can use the following methods to define the use of exceptional/highlighted risers in a graph. This is how conditional styling is implemented behind the scenes.

  • get/setExceptionalRiser(); Gets/sets exceptional risers at a particular series and group.
  • getExceptionalRisers(); Determines if there are any exceptional risers in a graph.
  • isExceptionalAllowed(); Determines if exceptional risers are allowed in a graph.
  • setNoExceptionalRiser(); Disallows exceptional risers in a graph.

Riser Automatic Color Rendering/Styling

How to:

There are two methods you can use to automatically render the color and style of graph risers:

  • Repeated Shading. You can automatically shade successive groups of risers by lightening or darkening the colors used for the risers in the previous group. This type of shading is implemented using color mode 4, a looping index, and a factor for lightening or darkening the colors.
  • Gradient Coloring. You can automatically create a gradient effect between the colors for the first and last risers by defining a starting color and ending color for the risers. This type of coloring is implemented using color mode 5, a starting color, and an ending color.

Syntax: How to Implement Automatic Repeated Riser Shading

You can automatically shade groups of risers by lightening or darkening the color values in each successive group. You implement this type of shading by setting the color mode to 4, setting a looping index equal to the number of risers in each group, and setting an automatic color lightening or darkening factor:

setColorMode(4);
setSeriesLooping(s);
setAutoColorLerpFactor(f);

where:

setColorMode(4);

Implements automatic repeated riser shading.

s

Identifies the number of risers in each group on the graph.

f

Is a double-precision number between -1 and 1 that represents the factor for lightening or darkening each successive group of risers. A positive factor specifies that each successive group of risers will be lighter than the previous group. A negative number specifies that each successive group of risers will be darker than the previous group. Zero indicates that each successive group of risers will be shaded exactly the same as the previous group.

Example: Implementing Automatic Repeated Riser Shading in a Pie Chart

The following request implements repeated lightening of groups of risers. It sets the color mode to 4, the series looping index to 5, and the automatic color factor to 1:

-DEFAULTH &WF_STYLE_HEIGHT='405';
-DEFAULTH &WF_STYLE_WIDTH='770';
GRAPH FILE EMPLOYEE
-* Created by Info Assist for Graph
SUM EMPLOYEE.PAYINFO.SALARY
BY EMPLOYEE.EMPINFO.LAST_NAME
WHERE EMPLOYEE.EMPINFO.LAST_NAME NE 'SMITH';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5); 
setCurveFitEquationDisplay(false); 
setDisplay(getDataText(0), false);
   .
   .
   .
setDisplay(getDataText(63), false);
setPieDepth(70);
setPieFeelerTextDisplay(1); 
setPlace(true);
-*Autoshade base on every 5 series setSeriesLooping(5);
setColorMode(4);   setAutoColorLerpFactor(1);  -*
*END
INCLUDE=IBFS:/CFG/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
ENDSTYLE
END

On the output, the riser colors repeat after five car values because the looping index is 5:

  • The riser color for JONES is a lighter version of the riser color for BANNING.
  • The riser color for MCCOY is a lighter version of the riser color for BLACKWOOD.
  • The riser color for MCKNIGHT is a lighter version of the riser color for CROSS.
  • The riser color for ROMANS is a lighter version of the riser color for GREENSPAN.
  • The riser color for STEVENS is a lighter version of the riser color for IRVING.

Syntax: How to Implement Automatic Gradient Riser Coloring

You can automatically create a gradient color effect between the risers in a graph. You implement this type of coloring by setting the color mode to 5, setting a starting color for the gradient, and setting an ending color for the gradient:

setColorMode(5);
setAutoColorGradientStartColor({Color.start_color|new Color(r1,g1,b1)});;
setAutoColorGradientEndColor({Color.end_color|new Color(r2,g2,b2)});

where:

setColorMode(5);

Implements automatic gradient riser shading.

start_color

Identifies the starting color for the gradient.

(r1,g1,b1)

Is the code for the red, green, and blue components of the starting color.

end_color

Identifies the ending color for the gradient.

(r2,g2,b2)

Is the code for the red, green, and blue components of the ending color.

Example: Implementing Automatic Gradient Riser Coloring

The following request implements automatic gradient riser coloring. It sets the color mode to 5, the start color to dark gray (192,192,192) and the end color to green (25,92,92):

-DEFAULTH &WF_STYLE_HEIGHT='405';
-DEFAULTH &WF_STYLE_WIDTH='770';
GRAPH FILE EMPLOYEE
-* Created by Info Assist for Graph
SUM EMPLOYEE.PAYINFO.SALARY
BY EMPLOYEE.EMPINFO.LAST_NAME
WHERE EMPLOYEE.EMPINFO.LAST_NAME NE 'SMITH';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5); 
setCurveFitEquationDisplay(false); 
setDisplay(getDataText(0), false);
   .
   .
   .
setDisplay(getDataText(63), false);
setPieDepth(70);
setPieFeelerTextDisplay(1); 
setPlace(true);
-*Gradient effect 
setColorMode(5);    
setAutoColorGradientStartColor(new Color(192,192,192));
setAutoColorGradientEndColor(new Color(25,92,92)); 
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
ENDSTYLE
END

On the output, the riser colors form a gradient from the start color (dark gray) to the end color (green):

WebFOCUS

Feedback