Advanced settings
Users have the option to customise elements of a graph's look and feel through the "Advanced settings" field. This can perform several tasks
- Change the graph and axis titles
- Change the font size, colour, and style
- Modify the legend position and style
As of Totara 13, the Advanced Settings field for Totara Graphical Reports is written in JSON format to specify custom settings that will work across all charting libraries. If you had specified INI settings in Totara 12 or below, a compatible version of your settings should already be present.
These settings are not specific to a charting library and will work when using both ChartJS and SVGGraph graphs.
Title Settings
Setting | Description |
|---|---|
| text | The title text to show on the graph Example: "Course Completion Report" |
| position | Where on the graph to display the title. Allowed values: "top", "left", "bottom", "right" |
| font | Font to use for the title. Only works if the user has the font installed. Example: "Times New Roman" |
| fontSize | Size of the text in the title in pixels. Example: 16 |
| fontStyle | Text style to apply to the title Example: "bold" |
| color | Colour for title text in hexadecimal or rgb Example: "#f0f0f0" |
| padding | Amount of space around the title text in pixels Example: 5 |
Example
|
Legend Settings
Setting | Description |
|---|---|
| display | Whether to show the legend Example: true |
| position | Where on the graph to display the legend. Allowed values: "top", "left", "bottom", "right" |
| font | Font to use for the legend items. Only works if the user has the font installed. Example: "Times New Roman" |
| fontSize | Size of the text in the legend in pixels. Example: 16 |
| fontStyle | Text style to apply to the legend Example: "bold" |
| color | Colour for legend text in hexadecimal or rgb Example: "#f0f0f0" |
| padding | Amount of space around the legend text in pixels Example: 5 |
Example
|
Tooltip Settings
Setting | Description |
|---|---|
| display | Whether to show tooltips Example: true |
| backgroundColor | The colour to set the tooltip background. Example: "#dad4da" |
| font | Font to use in tooltips. Only works if the user has the font installed. Example: "Times New Roman" |
| fontSize | Size of the text in the tooltip in pixels. Example: 16 |
| fontStyle | Text style to apply to the tooltip Example: "bold" |
| color | Colour for tooltip text in hexadecimal or rgb Example: "#f0f0f0" |
| borderRadius | The roundness of the edges of the tooltip (in pixels) Example: 2 |
| borderColor | The colour of the tooltip border Example: "#0a7b92" |
| borderWidth | The thickness of the tooltip border (in pixels) Example: 2 |
Example
|
Axis Settings
Axis settings need to be applied to either the "x" or "y" axis. The settings between each axis are identical.
Setting | Description |
|---|---|
| display | Whether to show the line for this axis Example: true |
| title | Axis label for the graph. These use the same settings as the Graph Title. |
| grid | Settings to control the axis grid. |
| grid → display | Whether to show the lines for the axis grid Example: true |
| grid → color | Colour of the axis grid lines Example: "#0ff000" |
Example
|
Library-specific Settings
If you want to write more advanced settings to take advantage of some of the extended capabilities of your charting library, you may use the "custom" settings field to pass settings directly to the library. These will not be cross-compatible.
Official documentation for SVGGraph
Official documentation for ChartJS
SVGGraph Example
|
ChartJS Example
|
Full Example
|