Skip to content

Commit f4565d9

Browse files
authored
Update index.rst
`event.detail.config.options.scales = { ... }` does not just format Y axis, it overrides all existing configuration for both axes.
1 parent 44f5193 commit f4565d9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Chartjs/doc/index.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,8 @@ custom Stimulus controller:
185185
console.log(event.detail.config);
186186
187187
// For instance you can format Y axis
188-
event.detail.config.options.scales = {
189-
y: {
190-
ticks: {
191-
callback: function (value, index, values) {
192-
/* ... */
193-
},
194-
},
195-
},
188+
event.detail.config.options.scales.y.ticks.callback = function (value, index, values) {
189+
/* ... */
196190
};
197191
}
198192

0 commit comments

Comments
 (0)