Skip to content

Commit 828da27

Browse files
committed
[Chartjs] Improve Y axis formatting example
1 parent 44f5193 commit 828da27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Chartjs/doc/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ custom Stimulus controller:
185185
console.log(event.detail.config);
186186
187187
// For instance you can format Y axis
188+
// Add a new scales config
188189
event.detail.config.options.scales = {
189190
y: {
190191
ticks: {
@@ -194,6 +195,12 @@ custom Stimulus controller:
194195
},
195196
},
196197
};
198+
// Add to an existing Y axis config
199+
event.detail.config.options.scales.y.ticks = {
200+
callback: function (value, index, values) {
201+
/* ... */
202+
},
203+
};
197204
}
198205
199206
_onConnect(event) {

0 commit comments

Comments
 (0)