Skip to content

Commit 65762c8

Browse files
authored
fix: fix chart plugins type (#786)
change chart plugins type from object to array, fix tests and examples #782
1 parent e39aa45 commit 65762c8

File tree

61 files changed

+171
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+171
-229
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export default {
129129
default: () => {}
130130
},
131131
plugins: {
132-
type: Object,
133-
default: () => {}
132+
type: Array,
133+
default: () => []
134134
}
135135
},
136136
data() {
@@ -183,8 +183,8 @@ export default defineComponent({
183183
default: () => {}
184184
},
185185
plugins: {
186-
type: Object as PropType<PluginOptionsByType<'bar'>>,
187-
default: () => {}
186+
type: Array as PropType<Plugin<'bar'>[]>,
187+
default: () => []
188188
}
189189
},
190190
setup(props) {

legacy/sandboxes/bar/src/components/Bar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export default {
5858
default: () => {}
5959
},
6060
plugins: {
61-
type: Object,
62-
default: () => {}
61+
type: Array,
62+
default: () => []
6363
}
6464
},
6565
data() {

legacy/sandboxes/bubble/src/components/Bubble.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/doughnut/src/components/Doughnut.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/line/src/components/Line.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/pie/src/components/Pie.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/polar-area/src/components/PolarArea.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/radar/src/components/Radar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/sandboxes/scatter/src/components/Scatter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default {
5757
default: () => {}
5858
},
5959
plugins: {
60-
type: Object,
61-
default: () => {}
60+
type: Array,
61+
default: () => []
6262
}
6363
},
6464
data() {

legacy/src/Charts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
chartCreate,
1515
chartDestroy,
1616
chartUpdate,
17-
getChartOptions,
1817
getChartData,
1918
setChartLabels,
2019
setChartDatasets,
@@ -59,8 +58,8 @@ export function generateChart(chartId, chartType, chartController) {
5958
default: () => {}
6059
},
6160
plugins: {
62-
type: Object,
63-
default: () => {}
61+
type: Array,
62+
default: () => []
6463
}
6564
},
6665
data() {
@@ -100,7 +99,8 @@ export function generateChart(chartId, chartType, chartController) {
10099
this.$data._chart = new ChartJS(canvasEl2DContext, {
101100
type: chartType,
102101
data: chartData,
103-
options: getChartOptions(options, this.plugins)
102+
options,
103+
plugins: this.plugins
104104
})
105105
}
106106
}

0 commit comments

Comments
 (0)