Skip to content

Commit

Permalink
fix: Make average hash a horizontal line
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv777 committed Sep 29, 2024
1 parent 2adb33a commit 1ac3041
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export class HomeComponent {
fill: false,
backgroundColor: textColorSecondary,
borderColor: textColorSecondary,
tension: 0.2,
pointRadius: 1,
pointHoverRadius: 5,
tension: 0,
pointRadius: 0,
borderWidth: 2,
borderDash: [5, 5]
}
]
};
Expand Down Expand Up @@ -140,9 +140,9 @@ export class HomeComponent {
this.chartData.labels = this.dataLabel;
this.chartData.datasets[0].data = this.dataData;

// Calculate average hashrate and push to chart data
this.dataDataAverage.push(this.calculateAverage(this.dataData));
this.chartData.datasets[1].data = this.dataDataAverage;
// Calculate average hashrate and fill the array with the same value for the average line
const averageHashrate = this.calculateAverage(this.dataData);
this.chartData.datasets[1].data = Array(this.dataData.length).fill(averageHashrate);

this.chartData = {
...this.chartData
Expand Down

0 comments on commit 1ac3041

Please sign in to comment.