Skip to content

Commit

Permalink
fix history charts performance
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshelkovenkov committed Feb 13, 2022
1 parent 548b90f commit 5d23819
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions src/app/components/history/history.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export class HistoryComponent implements OnInit {
chart: {
height: 500,
type: 'line',
background: 'transparent'
background: 'transparent',
animations: {
enabled: false
}
},
dataLabels: {
enabled: false
Expand Down Expand Up @@ -118,9 +121,10 @@ export class HistoryComponent implements OnInit {
labels: {
trim: false,
style: {
colors: '#f1f1f1'
colors: this.getTheme() === 'dark' ? '#f1f1f1' : '#000000'
}
},
type: 'datetime',
categories: this.getDates(),
},
tooltip: {
Expand All @@ -136,7 +140,7 @@ export class HistoryComponent implements OnInit {
]
},
grid: {
borderColor: '#f1f1f1'
borderColor: this.getTheme() === 'dark' ? '#f1f1f1' : '#808080'
}
};
}
Expand All @@ -152,7 +156,10 @@ export class HistoryComponent implements OnInit {
chart: {
height: 500,
type: 'line',
background: 'transparent'
background: 'transparent',
animations: {
enabled: false
}
},
dataLabels: {
enabled: false
Expand Down Expand Up @@ -188,9 +195,10 @@ export class HistoryComponent implements OnInit {
labels: {
trim: false,
style: {
colors: '#f1f1f1'
colors: this.getTheme() === 'dark' ? '#f1f1f1' : '#000000'
}
},
type: 'datetime',
categories: this.getDates(),
},
tooltip: {
Expand All @@ -206,7 +214,7 @@ export class HistoryComponent implements OnInit {
]
},
grid: {
borderColor: '#f1f1f1'
borderColor: this.getTheme() === 'dark' ? '#f1f1f1' : '#808080'
}
};
}
Expand All @@ -222,7 +230,10 @@ export class HistoryComponent implements OnInit {
chart: {
height: 500,
type: 'line',
background: 'transparent'
background: 'transparent',
animations: {
enabled: false
}
},
dataLabels: {
enabled: false
Expand Down Expand Up @@ -258,9 +269,10 @@ export class HistoryComponent implements OnInit {
labels: {
trim: false,
style: {
colors: '#f1f1f1'
colors: this.getTheme() === 'dark' ? '#f1f1f1' : '#000000'
}
},
type: 'datetime',
categories: this.getDates(),
},
tooltip: {
Expand All @@ -276,7 +288,7 @@ export class HistoryComponent implements OnInit {
]
},
grid: {
borderColor: '#f1f1f1'
borderColor: this.getTheme() === 'dark' ? '#f1f1f1' : '#808080'
}
};
}
Expand All @@ -292,7 +304,10 @@ export class HistoryComponent implements OnInit {
chart: {
height: 500,
type: 'line',
background: 'transparent'
background: 'transparent',
animations: {
enabled: false
}
},
dataLabels: {
enabled: false
Expand Down Expand Up @@ -328,9 +343,10 @@ export class HistoryComponent implements OnInit {
labels: {
trim: false,
style: {
colors: '#f1f1f1'
colors: this.getTheme() === 'dark' ? '#f1f1f1' : '#000000'
}
},
type: 'datetime',
categories: this.getDates(),
},
tooltip: {
Expand All @@ -346,7 +362,7 @@ export class HistoryComponent implements OnInit {
]
},
grid: {
borderColor: '#f1f1f1'
borderColor: this.getTheme() === 'dark' ? '#f1f1f1' : '#808080'
}
};
}
Expand Down Expand Up @@ -461,7 +477,7 @@ export class HistoryComponent implements OnInit {
return dates;
}
this.historyNumbers.forEach(h => {
dates.push(h.date.toLocaleDateString() + ' - ' + h.date.toLocaleTimeString());
dates.push(h.date.toISOString());
});

return dates;
Expand Down

0 comments on commit 5d23819

Please sign in to comment.