Skip to content

Commit 3ca0a0f

Browse files
committed
fix(core): update type to scaleType and backgroundColors to fillColors
1 parent 88b6b42 commit 3ca0a0f

File tree

13 files changed

+81
-132
lines changed

13 files changed

+81
-132
lines changed

packages/core/demo/demo-data/bar.ts

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { colors } from "./colors";
2-
import { getTheme } from "./themes";
32

43
export const groupedBarData = {
54
labels: ["Qty", "More", "Sold", "Restocking", "Misc"],
65
datasets: [
76
{
87
label: "Dataset 1",
9-
backgroundColors: [colors[0]],
8+
fillColors: [colors[0]],
109
data: [
1110
65000,
1211
-29123,
@@ -17,7 +16,7 @@ export const groupedBarData = {
1716
},
1817
{
1918
label: "Dataset 2",
20-
backgroundColors: [colors[1]],
19+
fillColors: [colors[1]],
2120
data: [
2221
32432,
2322
-21312,
@@ -28,7 +27,7 @@ export const groupedBarData = {
2827
},
2928
{
3029
label: "Dataset 3",
31-
backgroundColors: [colors[2]],
30+
fillColors: [colors[2]],
3231
data: [
3332
-12312,
3433
23232,
@@ -39,7 +38,7 @@ export const groupedBarData = {
3938
},
4039
{
4140
label: "Dataset 4",
42-
backgroundColors: [colors[3]],
41+
fillColors: [colors[3]],
4342
data: [
4443
-32423,
4544
21313,
@@ -58,14 +57,13 @@ export const groupedBarOptions = {
5857
primary: true,
5958
},
6059
bottom: {
61-
type: "labels",
60+
scaleType: "labels",
6261
secondary: true,
6362
},
6463
top: {
65-
type: "labels",
64+
scaleType: "labels",
6665
}
67-
},
68-
theme: getTheme()
66+
}
6967
};
7068

7169
// Simple bar
@@ -74,7 +72,7 @@ export const simpleBarData = {
7472
datasets: [
7573
{
7674
label: "Dataset 1",
77-
backgroundColors: colors,
75+
fillColors: colors,
7876
data: [
7977
65000,
8078
29123,
@@ -93,11 +91,10 @@ export const simpleBarOptions = {
9391
primary: true
9492
},
9593
bottom: {
96-
type: "labels",
94+
scaleType: "labels",
9795
secondary: true,
9896
}
99-
},
100-
theme: getTheme()
97+
}
10198
};
10299

103100

@@ -106,7 +103,7 @@ export const simpleBarTimeSeriesData = {
106103
datasets: [
107104
{
108105
label: "Dataset 1",
109-
backgroundColors: colors,
106+
fillColors: colors,
110107
data: [
111108
{
112109
date: new Date(2019, 0, 1),
@@ -140,11 +137,10 @@ export const simpleBarTimeSeriesOptions = {
140137
primary: true
141138
},
142139
bottom: {
143-
type: "time",
140+
scaleType: "time",
144141
secondary: true,
145142
}
146-
},
147-
theme: getTheme()
143+
}
148144
};
149145

150146
// Stacked bar
@@ -153,7 +149,7 @@ export const stackedBarData = {
153149
datasets: [
154150
{
155151
label: "Dataset 1",
156-
backgroundColors: [colors[0]],
152+
fillColors: [colors[0]],
157153
data: [
158154
65000,
159155
29123,
@@ -164,7 +160,7 @@ export const stackedBarData = {
164160
},
165161
{
166162
label: "Dataset 2",
167-
backgroundColors: [colors[1]],
163+
fillColors: [colors[1]],
168164
data: [
169165
32432,
170166
21312,
@@ -175,7 +171,7 @@ export const stackedBarData = {
175171
},
176172
{
177173
label: "Dataset 3",
178-
backgroundColors: [colors[2]],
174+
fillColors: [colors[2]],
179175
data: [
180176
12312,
181177
23232,
@@ -186,7 +182,7 @@ export const stackedBarData = {
186182
},
187183
{
188184
label: "Dataset 4",
189-
backgroundColors: [colors[3]],
185+
fillColors: [colors[3]],
190186
data: [
191187
32423,
192188
21313,
@@ -206,11 +202,10 @@ export const stackedBarOptions = {
206202
stacked: true
207203
},
208204
bottom: {
209-
type: "labels",
205+
scaleType: "labels",
210206
secondary: true,
211207
}
212-
},
213-
theme: getTheme()
208+
}
214209
};
215210

216211

@@ -219,7 +214,7 @@ export const stackedBarTimeSeriesData = {
219214
datasets: [
220215
{
221216
label: "Dataset 1",
222-
backgroundColors: [colors[0]],
217+
fillColors: [colors[0]],
223218
data: [
224219
{
225220
date: new Date(2019, 0, 1),
@@ -245,7 +240,7 @@ export const stackedBarTimeSeriesData = {
245240
},
246241
{
247242
label: "Dataset 2",
248-
backgroundColors: [colors[1]],
243+
fillColors: [colors[1]],
249244
data: [
250245
{
251246
date: new Date(2019, 0, 3),
@@ -271,7 +266,7 @@ export const stackedBarTimeSeriesData = {
271266
},
272267
{
273268
label: "Dataset 3",
274-
backgroundColors: [colors[2]],
269+
fillColors: [colors[2]],
275270
data: [
276271
{
277272
date: new Date(2019, 0, 1),
@@ -297,7 +292,7 @@ export const stackedBarTimeSeriesData = {
297292
},
298293
{
299294
label: "Dataset 4",
300-
backgroundColors: [colors[3]],
295+
fillColors: [colors[3]],
301296
data: [
302297
{
303298
date: new Date(2019, 0, 2),
@@ -332,9 +327,8 @@ export const stackedBarTimeSeriesOptions = {
332327
stacked: true
333328
},
334329
bottom: {
335-
type: "time",
336-
secondary: true,
330+
scaleType: "time",
331+
secondary: true
337332
}
338-
},
339-
theme: getTheme()
333+
}
340334
};

0 commit comments

Comments
 (0)