-
-
Notifications
You must be signed in to change notification settings - Fork 31
Advanced chart options
Analytics is using a predefined set of chart options to work with most use cases and devices.
If specific optimizations are required, the chart can be manipulated on report level.
- Chart options can be entered to change settings like axis parameters
- Data options can be entered to change settings like data series colors
The format needs to match the chartjs api. e.g.: https://www.chartjs.org/docs/latest/axes/cartesian/time.html
-
change the x-axis to write months and not days
{"scales": {"x": {"time": {"unit" : "month"}}}}
-
Input data just has day/month like "12.03" and missing year
{"scales": {"x": {"time": {"parser" : "DD.MM"}}}}
-
Input data is based on unix timestamp
{"scales": {"x": {"time": {"parser" : "X"}}}}
-
change the standard y-axis by using "primary"
{"scales": {"primary":{"min": -10, "max": 40}}}
- remove the area color for a chart with only one line
{"0": {"fill":"false"}}
Getting advanced parameters correct can be challenging with the chartjs api. To support analysis and debugging, you can access the generated chart object by using the following in the browser console
OCA.Analytics.chartObject