Skip to content

Commit 0c4e21c

Browse files
committed
Deleted scales property in chart creation because it didn't do anything. Tightened workaround to fewer lines of code
1 parent 189e744 commit 0c4e21c

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

src/pages/dashboard/dashboard.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,12 @@ export class DashboardPage {
3232
{
3333
backgroundColor: ["rgba(0,0,255, .6)", "rgba(255,0,0, .6)", "rgba(128,0,128, .6)", "rgba(0,128,0, .6)", "rgba(255,165,0, .6)", "rgba(0,128,128, .6)", "rgba(255,0,255, .6)", "rgba(0,255,0, .6)"],
3434
borderColor: "black",
35-
data: [10, 0, 5, 2, 2, 5, 8, 1]
35+
data: [1, 1, 1, 1, 1, 1, 1, 2]
3636
}
3737
]
3838
},
3939

4040
options: {
41-
scales: {
42-
ticks: {
43-
beginAtZero: true,
44-
min: 0,
45-
max: 10
46-
},
47-
},
4841
layout: {
4942
padding: {
5043
top: 55,
@@ -87,12 +80,10 @@ export class DashboardPage {
8780
}
8881
}
8982
});
90-
//This code down below is to fix a bug where I could not modify the scale in the options
83+
//This code down below is to fix a bug where I could not modify the scale in the options
9184
//key in the above code (It threw a typescript error even though it worked)
92-
this.chart.config.options.scale.ticks.beginAtZero = true;
9385
this.chart.config.options.scale.ticks.min = 0;
9486
this.chart.config.options.scale.ticks.max = 10;
95-
this.chart.config.options.scale.ticks.stepSize = 1;
9687
this.chart.update();
9788
}
9889

src/pages/transition/transition.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,8 @@ export class TransitionPage {
144144

145145
//This code down below is to fix a bug where I could not modify the scale in the options
146146
//key in the above code (It threw a typescript error even though it worked)
147-
this.chart.config.options.scale.ticks.beginAtZero = true;
148147
this.chart.config.options.scale.ticks.min = 0;
149148
this.chart.config.options.scale.ticks.max = 10;
150-
this.chart.config.options.scale.ticks.stepSize = 1;
151-
this.chart.data.datasets.data = [0, 0, 0, 0, 0, 0, 0, 0];
152-
this.chart.data.datasets.data[0] = 0;
153149
this.chart.update();
154150
}
155151

0 commit comments

Comments
 (0)