You want to display data as a bullet chart.
|
Table of Contents
|
Download the sample Klip for examples discussed below.
See the Expected data format article for details.

Here is how the data points are used in case of format: "bullet" or format: "bullet(1)":

Regardless of how the data source is provided to the chart, the available formatting options are the same.
type: graph;
itemcol: 6;
format: "bullet";

You will notice that the marker lines for the two charts are not aligned, even though they are both at 2. This is because the range of each chart is set to the largest value in its source. For example, the largest value for the first item is 12, so its chart spans from 0 to 12. The second chart is spanning from 0 to 10, its largest value. All values in each set are placed relative to this range; therefore, the same values are drawn at different locations.
To set the range of all charts in the column, add the format value "range(0,y)" where y is the value for the right-most edge.
For example, if you expect the data points to fall between 0 and 15, you could set the range to (0,15):
type: graph;
itemcol: 7;
format: "bullet,range(0,15)";

Available in version 5.5 and later.
To set the range of all charts in the column, add the format value "range(max)". At each refresh, the Klip will automatically detect the largest data value in the column and use it as the value for the right-most edge.
type: graph;
itemcol: 8;
format: "bullet,range(max)";

Because the largest value for the chart is currently 12, the range is automatically set to (0,12). If the largest value becomes 15 at the next refresh, the range will automatically be set to (0,15). If it becomes 8, the range will adjust itself to (0,8).
The "largest value" may be the bullet, marker, or (a segment of) the bar chart.
You can use the format value "colorbands(colour1,colour2,colour3,...) to specify colours for the bar chart in the background. The available colours are: violet, blue, turquoise, red, yellow, green, and orange.
Note that, when using colorbands, the bullet(s) and marker are drawn in black by default. Therefore, it is recommended to be used only with format: "bullet" or format: "bullet(1)".
type: graph;
itemcol: 9;
format: "bullet,colorbands(violet,orange,blue)";

Available in version 5.5 and later.
You can specify the order in which the shades of the default background colours appear with the format value "colorbands()" using greyscale values. The available values are: 0, 20, 40, 60, 80, and 100.
Note that, when using colorbands, the bullet(s) and marker are drawn in black by default. Therefore, it is recommended to be used only with format: "bullet" or format: "bullet(1)".
type: graph;
itemcol: 10;
format: "bullet,colorbands(20,60,100)";

Available in version 5.5 and later.
You can specify the bullet colours depending on whether its value is smaller or larger than the marker value using format: "highlight(colour1,colour2)", where colour1 is applied to the bullets whose values are less than the marker, and colour2 is applied to bullets that represent values that are larger than the marker value.
The available colours are: violet, blue, turquoise, red, yellow, green, and orange.
For example:
type: graph;
itemcol: 11;
format: "bullet,highlight(red,violet)";

Here, because each chart's bullet value is larger than the marker value, both bullets are displayed in violet.
You can specify bullet colours according to a desired range of values. The range of values is defined by adding the <assets> block above your <style> block, and the CSS property asset is used to point to the name of the asset.
The available colours for assets are the same as for the colorbands: violet, blue, turquoise, red, yellow, green, and orange.
For example, we can set up the assets above the <style> block of the Klip as follows:
<assets>
<good>green</good>
<ok>yellow</ok>
<bad>red</bad>
<asset name="achievement">
<![CDATA[
good: value >= 8;
ok: value >= 4;
bad: value < 4;
]]>
</asset>
</assets>
This means, "Use green for any 'good' values, use yellow for the 'ok' values, and use red for the 'bad' values." In the <asset name="achievement"> block, we define good, ok and bad and call this set of value definitions "achievement".
Then, in the style definition, you specify that the asset named "achievement" should be used for the bullet:
type: graph;
itemcol: 12;
format: "bullet";
asset: "achievement";
This results in this display:

Notice that the first item's bullet for 9 is green because it is larger than 8, which is defined as good.
The second item's bullet is yellow because it is 7, which was set up as ok.
type: graph;
itemcol: 13;
format: "bullet";
legend: "Performance,Target,Poor,Good,Great";
label: "8. legend";
The above results in the following. Note how the label value ("8. legend") is used as the title of the legend in the tooltip of the column header.

When using the legend property, it is displayed by default as shown above, but you can toggle between it and the column label by right-clicking on the column header:

When the legend is hidden, the first menu option from right-clicking on the column header changes to "Show legend":

To set the default visibility of the legend, see example 9 below.
Use the headerlegend property with one of the following values to set up the column header:
type: graph;
itemcol: 7;
format: "bullet";
legend: "Performance,Target,Poor,Good,Great";
label: "6. legend+headerlegend";
headerlegend: off;
The following screenshot is from using headerlegend: off. Note the lack of "Show legend" option in its right-click menu:

type: graph;
itemcol: 15;
format: "bullet,range(0,15),colorbands(violet,orange,blue)";
legend: "Performance,Target,Poor,Good,Great";
headerlegend: hidden;
label: "15. range+colobands+legend+headerlegend";

For example, using format: "bullet(2)", the data points are used as follows:

And the charts would look like this (note how the bullet values are stacked):

If you do not want to display a bullet, use format: "bullet(0)".
Now, the same sets of data are used as follows:

The Klip will look like this:

In the first item, 9 is the marker, with 2, 3, 6 and 12 used in the bar chart; in the second item, 7 is the marker, with the rest of the values used in the bar chart.