BPCharts

   

Table of Contents

  1. Overview
  2. Chart Dimension (chdm)
  3. Chart Data (chd)
  4. Chart Labels (chxl)
  5. Colors (chcm)
  6. Color Ranges (chcor)
  7. Fills (chf)
  8. Font Name (chft)
  9. Font Size (chfts)
  10. Margins (chmg)

Overview

This is a matrix Chart mtx. The size of the matrix can be changed and is 2x5 by default. The chart type code is mtx.

Chart Dimension chdm

The size of the matrix can be specified with the new parameter chdm=<lines>x<rows>

Example

Description Image
Create a 4x13 matrix.
chcm=EF6510,1
Create a 7x3 matrix
chcm=EF6510,1,2|
9F375F,2,3

Chart Data chd

Fills the Cells of the matrix with Numbers. For the external representation the data gets rounded and displayed as integers.

There are two ways to parse data

Syntax 1

chd=<value_1>[,...,<value_n>]

This way the matrix gets filled line by line from left to right

Syntax 2

chd=<line_1>,<value_1>[,...,value_k>][|...|<line_n>,<value_1>[,...,value_k>]]

This way the line specified gets filled from left to right with the given values.

Custom Labels chxl

The chxl option allows you to manually specify the labels for an axis.

Syntax

chxl=<axis_index_1>:<label_1>,...,<label_n>[|...|<axis_index_n>:<label_1>,...,<label_n>]

axis_index= 0 labels columns on the bottom of the matrix, axis_index = 1 labels lines on the right.

Example

Description Image
Some very generic labels
chxl=0:cl_1|cl_2|1:ln_1

Colors chcm

The chcm option allows you to color the matrix.

Syntax

chcm=<color_1>,<line_1>[,<first_column>[,<last_column>]][|...|<color_n>,<line_n>[,<first_column>[,<last_column>]]

If the parameter first_column ist not given, the entire line gets colored. If last_column is not given or 0, the entire row beginning with first_column gets colored

Examples

Description Image
Render the first line of the matrix orange.
chcm=EF6510,1
Render the first two cells in the first line orange and all cells in the second line from the third cell onwards violett
chcm=EF6510,1,2|
9F375F,2,3

Color Ranges (chcor)

This parameter allows you to control the colors of the matrix by specifying the colors that apply to specific numeric ranges. This parameter is optional and if given superseeds the chcm color specifications.

A number that falls outside of any numeric ranges specified by this parameter will be rendered in a gray color.

Syntax

chcor=<opt_lower_1>,<opt_upper_1>,<bg_color_1>,<opt_fg_color_1>
|...|
<opt_lower_n>,<opt_upper_n>,<bg_color_n>,<opt_fg_color_n>
<opt_lower>
[Optional] The lower value, inclusive, of the numeric range. If a value is not specified it means negative infinity.
<opt_upper>
[Optional] The upper value, exclusive, of the numeric range. If a value is not specified it means positive infinity.
<bg_color>
The background color, in RRGGBB or RRGGBBAA format, to apply to the numeric range.
<opt_fg_color>
[Optional] The foreground color, in RRGGBB or RRGGBBAA format, to apply to the numeric range. Defaults to black.

Example

Description Image
Render the matrix in shades of orange to match the matrix.
chcor=,10,FFDBC6|
  10,25,F7B284|
  25,50,EF864A|
  50,,EF6510
Render values less than 10 with a dark gray (333333) background and light gray (999999) foreground and render values greater than 10 with a light gray (999999) background and a dark gray (333333) foreground.
chcor=,10,333333,999999|
  10,,999999,333333

Fills (chf)

The background color of the chart can be controlled using the chart fill option.

Syntax

chf=<fill_type>,s,<color>
<fill_type>

The part of the chart being filled. Specify one of the following values:

  • bg - Background fill
s
Indicates a solid fill.
<color>
The fill color, in RRGGBB or RRGGBBAA format.

Example

Description Image
Fill the chart background with pale grey (EFEFEF).
chf=bg,s,EFEFEF
Fill the chart background with semi-transparent blue (0000FFCC).
chf=bg,s,0000FFCC

Font Name (chft)

The font used to render the chart can be specified using the chart font name option.

For raster (e.g. PNG) charts, only fonts which exist on the BPCharts server may be used. For vector (e.g. SVG) charts, the font does not need to exist on the BPCharts server but the client which renders the SVG must have the font installed.

Syntax

chft=<font_name>
<font_name>
The name of the font to use to render the chart.

Example

Description Image
Render a PNG chart using the Times New Roman font.
chft=Times New Roman
Render a SVG chart using the Morningstar 1 font. This will only be rendered correctly if the machine viewing this web page has the Morningstar 1 font installed.
chft=Morningstar 1
chof=s

Font Size (chfts)

The size font used to render the chart can be specified using the chart font size option. The size of the chart elements, such as the legend, will be adjusted automatically.

For raster (e.g. PNG) charts, the chart font size is measured in pixels. For vector (e.g. SVG) charts, the chart font size is measured in points.

The default font size for raster charts is 11 pixels tall. The default font size for vector charts is 8 points tall.

Syntax

chfts=<font_size>
<font_size>
The size of the font to use to render the chart.

Example

Description Image
Render a PNG chart using an 8-pixel tall font.
chfts=8
Render a SVG chart using an 12-point tall font.
chfts=12
chof=s

Margins (chmg)

A chart's margins are defined as the area outside of the rendering of the chart data itself. The chart margin may include labels or legends.

By default, BPCharts automatically picks chart margins which fit the labels and legends.

Syntax

chmg=<top>,<right>,<bottom>,<left>
<top>
The top margin for the chart.
<right>
The right margin for the chart.
<bottom>
The bottom margin for the chart.
<left>
The left margin for the chart.

Example

Description Image
Eliminate everything but the chart itself by setting all margins to 0. Works only if the image size has the same ratio as the matrix
chmg=0,0,0,10