Skip to content

Commit 432d1e6

Browse files
authored
move option to correct namespace (#10613)
* move option to correct namespace * change plugin name from snake_case to camelCase
1 parent b0a06d1 commit 432d1e6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/configuration/canvas-background.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const data = {
3333
// <block:plugin:2>
3434
// Note: changes to the plugin code is not reflected to the chart, because the plugin is loaded at chart construction time and editor changes only trigger an chart.update().
3535
const plugin = {
36-
id: 'custom_canvas_background_color',
36+
id: 'customCanvasBackgroundColor',
3737
beforeDraw: (chart, args, options) => {
3838
const {ctx} = chart;
3939
ctx.save();
@@ -51,7 +51,9 @@ const config = {
5151
data: data,
5252
options: {
5353
plugins: {
54-
color: 'lightGreen',
54+
customCanvasBackgroundColor: {
55+
color: 'lightGreen',
56+
}
5557
}
5658
},
5759
plugins: [plugin],
@@ -95,7 +97,7 @@ const image = new Image();
9597
image.src = 'https://www.chartjs.org/img/chartjs-logo.svg';
9698

9799
const plugin = {
98-
id: 'custom_canvas_background_image',
100+
id: 'customCanvasBackgroundImage',
99101
beforeDraw: (chart) => {
100102
if (image.complete) {
101103
const ctx = chart.ctx;

docs/developers/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ import {ChartType, Plugin} from 'chart.js';
195195

196196
declare module 'chart.js' {
197197
interface PluginOptionsByType<TType extends ChartType> {
198-
custom_canvas_background_color?: {
198+
customCanvasBackgroundColor?: {
199199
color?: string
200200
}
201201
}

0 commit comments

Comments
 (0)