From 11c8c73319740520eb142359e310874a1cbf2c86 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 9 Aug 2024 00:07:23 +0100 Subject: [PATCH] Modify js charts --- static/js/bitcoin-business-growth-chart.js | 9 ++------- static/js/bitcoin-business-growth-table.js | 2 +- static/js/chart-params.js | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/static/js/bitcoin-business-growth-chart.js b/static/js/bitcoin-business-growth-chart.js index 6b891dc..9082373 100644 --- a/static/js/bitcoin-business-growth-chart.js +++ b/static/js/bitcoin-business-growth-chart.js @@ -32,12 +32,7 @@ function updateChart() { option = { backgroundColor: backgroundColor, grid: grid, - tooltip: { - backgroundColor: tooltipBgColor, - order: "seriesDesc", - textStyle: textStyleMain, - trigger: "axis", - }, + tooltip: tooltip, toolbox: toolboxParams, xAxis: { axisTick: axisTick, @@ -54,7 +49,7 @@ function updateChart() { fontSize: 12 * fontScale, color: textColor, formatter(value, index) { - return nFormatter(value, 0); + return nFormatter(value, 2); }, }, axisLine: axisLine, diff --git a/static/js/bitcoin-business-growth-table.js b/static/js/bitcoin-business-growth-table.js index 4ac90b5..efa5bbf 100644 --- a/static/js/bitcoin-business-growth-table.js +++ b/static/js/bitcoin-business-growth-table.js @@ -51,7 +51,7 @@ function createTable(data) { const tr = document.createElement("tr"); const checkbox = document.createElement("input"); checkbox.type = "checkbox"; - checkbox.checked = index < 5; // Check the top 5 rows by default + checkbox.checked = index < 1; checkbox.addEventListener("change", function () { if (this.checked) { checkedBoxes.push(row["country_name"]); diff --git a/static/js/chart-params.js b/static/js/chart-params.js index bc0dd63..d6e023f 100644 --- a/static/js/chart-params.js +++ b/static/js/chart-params.js @@ -19,7 +19,7 @@ const tooltip = { }; const toolboxParams = { - itemSize: 8 * fontScale, + itemSize: 16 * fontScale, showTitle: true, top: "-1%", right: "20%",