changed default chart animation length

This commit is contained in:
Miodec 2022-02-20 02:04:31 +01:00
parent 4d5c4dacbb
commit 543f417406
4 changed files with 10 additions and 8 deletions

View file

@ -49,7 +49,7 @@ export function updateData(data: MonkeyTypes.ChartData): void {
ChartController.miniResult.options.scales.yAxes[1].ticks.min = 0;
}
ChartController.miniResult.update({ duration: 0 });
ChartController.miniResult.update();
}
$(document).on("click", ".pageAccount .miniResultChartBg", () => {

View file

@ -5,6 +5,8 @@ import * as Misc from "../misc";
import Config from "../config";
import * as ConfigEvent from "../observables/config-event";
Chart.defaults.global.animation.duration = 250;
export let result = new Chart($("#wpmChart"), {
type: "line",
data: {
@ -737,7 +739,7 @@ export async function updateColors(chart) {
// },
// });
chart.update({ duration: 250 });
chart.update();
}
Chart.prototype.updateColors = function () {

View file

@ -176,8 +176,8 @@ export function reset(): void {
ChartController.accountActivity.data.datasets[1].data = [];
ChartController.accountHistory.data.datasets[0].data = [];
ChartController.accountHistory.data.datasets[1].data = [];
ChartController.accountActivity.update({ duration: 0 });
ChartController.accountHistory.update({ duration: 0 });
ChartController.accountActivity.update();
ChartController.accountHistory.update();
}
type ChartData = {
@ -228,7 +228,7 @@ export function smoothHistory(factor: number): void {
ChartController.accountHistory.data.datasets[0].data = chartData2;
ChartController.accountHistory.data.datasets[1].data = accChartData2;
ChartController.accountHistory.update({ duration: 0 });
ChartController.accountHistory.update();
}
function applyHistorySmoothing(): void {
@ -865,7 +865,7 @@ export function update(): void {
);
applyHistorySmoothing();
ChartController.accountActivity.update({ duration: 0 });
ChartController.accountActivity.update();
LoadingPage.updateBar(100, true);
setTimeout(() => {
SignOutButton.show();

View file

@ -109,7 +109,7 @@ async function updateGraph() {
ChartController.result.options.scales.yAxes[0].ticks.max = maxChartVal;
ChartController.result.options.scales.yAxes[1].ticks.max = maxChartVal;
ChartController.result.update({ duration: 0 });
ChartController.result.update();
ChartController.result.resize();
}
@ -159,7 +159,7 @@ export async function updateGraphPBLine() {
Math.round(maxChartVal);
ChartController.result.options.scales.yAxes[1].ticks.max =
Math.round(maxChartVal);
ChartController.result.update({ duration: 0 });
ChartController.result.update();
}
function updateWpmAndAcc() {