From Dark and Darker Wiki
(Brief documentation of chart parameters.) |
(Attempting to make y-axis label larger.) |
||
(One intermediate revision by the same user not shown) | |||
Line 40: | Line 40: | ||
text:title, | text:title, | ||
font: { | font: { | ||
size: | size: 22 | ||
}, | }, | ||
color:fontColor | color:fontColor | ||
Line 58: | Line 58: | ||
text:yAxisLabel, | text:yAxisLabel, | ||
display:yAxisBoolean, | display:yAxisBoolean, | ||
color:fontColor | color:fontColor, | ||
font: { | |||
size: 18 | |||
} | |||
}, | }, | ||
grid: { | grid: { | ||
Line 67: | Line 70: | ||
}, | }, | ||
ticks: { | ticks: { | ||
color:fontColor | color:fontColor, | ||
font: { | |||
size: 18 | |||
} | |||
} | } | ||
}, | }, |
Latest revision as of 07:19, 23 June 2024
Parameters
uniqueId
- Determines canvas element name
- Name needs to be unique if multiple widgets are to be displayed on the same page.
title
- Default:
""
empty string - String of text to display as the title of the graph.
- This string also serves to detemine whether or not to show the legend.
If no string is provided both the legend and the title are not displayed.
yAxisLabel
- Default:
""
empty string - String of text to display on the y-axis. Text is rendered vertically, bottom to top.
xAxisLabel
- Default:
""
empty string - String of text to display on the x-axis.
gridColor
- Default:
'#80808080'
axisColor
- Default:
var gridColor
fontColor
- Default:
'white'
datasets
- String of text that is a properly formatted JSON object when parsed by
JSON.parse()
. The graph will not render if an improper JSON object is passed.
It is recommended that you check the string format with some sort of tool like JSON Lint, or whatever else you prefer. - The first set of objects within the JSON object must have the "datasets" array pair.
- For specifics on what options and formats are available, please see the official Chart.js documentation.
Example
{{#widget:DatasetsChart|uniqueId=ExampleChart|title=This String Becomes the Title|datasets={"labels":[0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500],"datasets":[{"label":"Luck Grade 5","data":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],"borderColor":"#AD5AFF","backgroundColor":"#AD5AFFBB"},{"label":"Luck Grade 6","data":[1, 3, 6, 8, 10, 12, 14, 16, 18, 20, 22],"borderColor":"#F7A22D","backgroundColor":"#F7A22DBB"}]}|}}