Skip to content

Commit

Permalink
fix(core): update type to scaleType and backgroundColors to fillColors
Browse files Browse the repository at this point in the history
  • Loading branch information
theiliad committed Oct 29, 2019
1 parent 88b6b42 commit 3ca0a0f
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 132 deletions.
58 changes: 26 additions & 32 deletions packages/core/demo/demo-data/bar.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { colors } from "./colors";
import { getTheme } from "./themes";

export const groupedBarData = {
labels: ["Qty", "More", "Sold", "Restocking", "Misc"],
datasets: [
{
label: "Dataset 1",
backgroundColors: [colors[0]],
fillColors: [colors[0]],
data: [
65000,
-29123,
Expand All @@ -17,7 +16,7 @@ export const groupedBarData = {
},
{
label: "Dataset 2",
backgroundColors: [colors[1]],
fillColors: [colors[1]],
data: [
32432,
-21312,
Expand All @@ -28,7 +27,7 @@ export const groupedBarData = {
},
{
label: "Dataset 3",
backgroundColors: [colors[2]],
fillColors: [colors[2]],
data: [
-12312,
23232,
Expand All @@ -39,7 +38,7 @@ export const groupedBarData = {
},
{
label: "Dataset 4",
backgroundColors: [colors[3]],
fillColors: [colors[3]],
data: [
-32423,
21313,
Expand All @@ -58,14 +57,13 @@ export const groupedBarOptions = {
primary: true,
},
bottom: {
type: "labels",
scaleType: "labels",
secondary: true,
},
top: {
type: "labels",
scaleType: "labels",
}
},
theme: getTheme()
}
};

// Simple bar
Expand All @@ -74,7 +72,7 @@ export const simpleBarData = {
datasets: [
{
label: "Dataset 1",
backgroundColors: colors,
fillColors: colors,
data: [
65000,
29123,
Expand All @@ -93,11 +91,10 @@ export const simpleBarOptions = {
primary: true
},
bottom: {
type: "labels",
scaleType: "labels",
secondary: true,
}
},
theme: getTheme()
}
};


Expand All @@ -106,7 +103,7 @@ export const simpleBarTimeSeriesData = {
datasets: [
{
label: "Dataset 1",
backgroundColors: colors,
fillColors: colors,
data: [
{
date: new Date(2019, 0, 1),
Expand Down Expand Up @@ -140,11 +137,10 @@ export const simpleBarTimeSeriesOptions = {
primary: true
},
bottom: {
type: "time",
scaleType: "time",
secondary: true,
}
},
theme: getTheme()
}
};

// Stacked bar
Expand All @@ -153,7 +149,7 @@ export const stackedBarData = {
datasets: [
{
label: "Dataset 1",
backgroundColors: [colors[0]],
fillColors: [colors[0]],
data: [
65000,
29123,
Expand All @@ -164,7 +160,7 @@ export const stackedBarData = {
},
{
label: "Dataset 2",
backgroundColors: [colors[1]],
fillColors: [colors[1]],
data: [
32432,
21312,
Expand All @@ -175,7 +171,7 @@ export const stackedBarData = {
},
{
label: "Dataset 3",
backgroundColors: [colors[2]],
fillColors: [colors[2]],
data: [
12312,
23232,
Expand All @@ -186,7 +182,7 @@ export const stackedBarData = {
},
{
label: "Dataset 4",
backgroundColors: [colors[3]],
fillColors: [colors[3]],
data: [
32423,
21313,
Expand All @@ -206,11 +202,10 @@ export const stackedBarOptions = {
stacked: true
},
bottom: {
type: "labels",
scaleType: "labels",
secondary: true,
}
},
theme: getTheme()
}
};


Expand All @@ -219,7 +214,7 @@ export const stackedBarTimeSeriesData = {
datasets: [
{
label: "Dataset 1",
backgroundColors: [colors[0]],
fillColors: [colors[0]],
data: [
{
date: new Date(2019, 0, 1),
Expand All @@ -245,7 +240,7 @@ export const stackedBarTimeSeriesData = {
},
{
label: "Dataset 2",
backgroundColors: [colors[1]],
fillColors: [colors[1]],
data: [
{
date: new Date(2019, 0, 3),
Expand All @@ -271,7 +266,7 @@ export const stackedBarTimeSeriesData = {
},
{
label: "Dataset 3",
backgroundColors: [colors[2]],
fillColors: [colors[2]],
data: [
{
date: new Date(2019, 0, 1),
Expand All @@ -297,7 +292,7 @@ export const stackedBarTimeSeriesData = {
},
{
label: "Dataset 4",
backgroundColors: [colors[3]],
fillColors: [colors[3]],
data: [
{
date: new Date(2019, 0, 2),
Expand Down Expand Up @@ -332,9 +327,8 @@ export const stackedBarTimeSeriesOptions = {
stacked: true
},
bottom: {
type: "time",
secondary: true,
scaleType: "time",
secondary: true
}
},
theme: getTheme()
}
};
Loading

0 comments on commit 3ca0a0f

Please sign in to comment.