Bullet Chart Properties (bulletProperties)

How to:

The drawFirstValueAsBar property controls the general appearance of a bullet chart.

Syntax: How to Control the Appearance of a Bullet Chart

"bulletProperties": {
   "drawFirstValueAsBar": boolean},

where:

"drawFirstValueAsBar": boolean

Valid values are:

  • true, which draws the first data value as a bar. This is the default value.
  • false, which draws the first data value as a marker.

Example: Controlling the Appearance of a Bullet Chart

The following request creates a bullet chart using the default value (true) for the drawFirstValueAsBar property

GRAPH FILE WF_RETAIL_LITE
SUM MSRP_US
BY PRODUCT_CATEGORY
WHERE PRODUCT_CATEGORY EQ 'Accessories' OR 'Computers' OR 'Stereo Systems'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VAXIS 80
ON GRAPH SET LOOKGRAPH CUSTOM
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
*GRAPH_JS
"chartType": "bullet",
"border": {"width": 1, "color": "navy"},
"bulletProperties": {"drawFirstValueAsBar": true},
"dataLabels": {"visible": true, "font": "6pt"},
"yaxis": {"colorBands": [
	{"start": 0, "stop": 80000000, "color": "silver"},
	{"start": 80000000, "stop": 150000000, "color": "lightgrey"},
	{"start": 150000000, "stop": 200000000, "color": "whitesmoke"}]},
"series": [
	{"series": "all", "showDataValues": true},
	{"series": 0, "group": 0, "color": "yellow",
		"marker": {"size": 15, "position": "bottom", "shape": "triangle"}},
	{"series": 0, "group": 1, "color": "red",
		"marker": {"size": 15, "position": "top", "shape": "triangle"}},
	{"series": 0, "group": 2, "color": "blue",
		"marker": {"size": 15, "position": "middle", "shape": "triangle"}}]
*END
ENDSTYLE
END

On the chart, the first data value is represented by a yellow bar, and the other data values are represented by red and blue triangles:

Bullet chart showing the first value as a bar

Changing the value of drawFirstValueAsBar to false generates a chart on which the yellow marker is now a triangle:

Bullet chart in which all 3 values are shown as triangle markers

WebFOCUS

Feedback