Structure
{mainTitle} | |||
{subTitle} | |||
importance secondary | importance primary | Chart Legend | |
importance primary | |||
importance primary |
Behavior
It is possible to produce a bar chart inside a table by adding a column, marking it with the text “Chart Legend” and adding a DimensionGroup
of type bars
.
If there are column groups in the table style, the “Chart Legend” text should be on the level of the column groups. The chart legend is then produced by merging the column group and column cells together.
The bars themselves are generated by placing in the chart column for each row a table which consists of two cells. One cell is the filled out bar and the other is basically the padding.
The bars start with the height defined in the configuration file setting tablechart.barheightInPt
and shrink proportionally until tablechart.minimumbarheightInPt
is reached.
The axis can be styled by setting tablechart.axisbordercolor
and tablechart.axisborderwidth
in the configuration file.
The colors are chosen from the theme specified in VerticalTableNode.theme
or the configuration file. They are applied in the order they are defined in the themes section of the word template. If there are more bars than colors, the cycle continues from the beginning.
The axis is positioned based on the data in the abstract report. There are four positions with a distance of 25% of the column width of eachother. If there are no negative values, the axis is placed at position 0 (i.e. to the left). If there are only negative values smaller than 25% of the total, the axis is positioned at position 1 (which is at 25% of the column width) and so forth. Please see the the examples section for concrete applications of this principle.
The formatting of the cell with the text “Chart Legend” is copied and used for formatting the produced chart legend. It is also possible to specify left and right margins in each cell beneath the “Chart Legend” cell.
The column width can be set by either setting the metadata (the JSON comment), the DimensionGroup.width
property or if nothing is set, the actual column width in percent in the table style.
The chart legend is not created if at least one chart column does not have its name set or if it is set to an empty string.
Examples
Example 1: Showing a simple case with a one bar chart
Example 2: Showing how the values determine the axis position
Example 3: Showing how bar colors are repeated
Example 4: Showing how to change the left and right margin
Example 5: Showing how to set the column width using a chartColumnWidths mapping in the metadata (JSON comment)
Example 6: Showing how to set the column width in the abstract report
Add Comment