Skip to content

Commit f73f75d

Browse files
authored
Improve examples for formatting Y axis
Add an example for adding to an existing Y axis config without overriding it.
1 parent 26694ec commit f73f75d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Chartjs/doc/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ custom Stimulus controller:
185185
console.log(event.detail.config);
186186
187187
// For instance you can format Y axis
188+
// Add a new scales config
189+
event.detail.config.options.scales = {
190+
y: {
191+
ticks: {
192+
callback: function (value, index, values) {
193+
/* ... */
194+
}
195+
}
196+
}
197+
};
198+
// Add to an existing Y axis config
188199
event.detail.config.options.scales.y.ticks = {
189200
callback: function (value, index, values) {
190201
/* ... */

0 commit comments

Comments
 (0)