changed graph type to bar and color to bosch dark blue
This commit is contained in:
parent
b65f1126fc
commit
80664740a8
@ -116,24 +116,14 @@ export class HomeComponent implements OnInit {
|
||||
async initChart() {
|
||||
const data = await this.getData();
|
||||
|
||||
const canvas = document.getElementById('myChart') as HTMLCanvasElement;
|
||||
const width = canvas.clientWidth;
|
||||
const height = canvas.clientHeight;
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
var img = new Image(width, height);
|
||||
img.src = "/assets/imgs/supergraphic.svg";
|
||||
img.onload = () => {
|
||||
const fillPattern = ctx.createPattern(img, 'no-repeat');
|
||||
|
||||
this.myChart = new Chart("myChart", {
|
||||
type: 'line',
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: data.names,
|
||||
datasets: [{
|
||||
label: 'Number of samples per group',
|
||||
data: data.count,
|
||||
backgroundColor: fillPattern,
|
||||
backgroundColor: 'rgba(0, 86, 145, 1)',
|
||||
pointRadius: 4,
|
||||
pointHoverRadius: 7
|
||||
}]
|
||||
@ -150,4 +140,3 @@ export class HomeComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user