From 340b68f8b324aaf93a2eccc5198c5f5107383e6d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 10 Feb 2022 19:02:52 +0900 Subject: [PATCH] enhance(client): tweak chart --- packages/client/src/components/chart.vue | 17 +++++++++++++---- .../client/src/components/instance-stats.vue | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/chart.vue b/packages/client/src/components/chart.vue index 5865715de..d4c6f9d44 100644 --- a/packages/client/src/components/chart.vue +++ b/packages/client/src/components/chart.vue @@ -213,17 +213,17 @@ export default defineComponent({ data: x.data.slice().reverse(), tension: 0.3, pointRadius: 0, - borderWidth: 2, + borderWidth: props.bar ? 0 : 2, borderColor: x.color ? x.color : getColor(i), borderDash: x.borderDash || [], borderJoinStyle: 'round', - backgroundColor: alpha(x.color ? x.color : getColor(i), 0.1), - gradient: { + backgroundColor: props.bar ? (x.color ? x.color : getColor(i)) : alpha(x.color ? x.color : getColor(i), 0.1), + gradient: props.bar ? undefined : { backgroundColor: { axis: 'y', colors: { 0: alpha(x.color ? x.color : getColor(i), 0), - [maxes[i]]: alpha(x.color ? x.color : getColor(i), 0.1), + [maxes[i]]: alpha(x.color ? x.color : getColor(i), 0.15), }, }, }, @@ -752,18 +752,27 @@ export default defineComponent({ type: 'line', borderDash: [5, 5], data: format(sum(raw.inc, negate(raw.dec))), + color: '#888888', }]), { + name: 'With file', + type: 'area', + data: format(raw.diffs.withFile), + color: colors.purple, + }, { name: 'Renotes', type: 'area', data: format(raw.diffs.renote), + color: colors.green, }, { name: 'Replies', type: 'area', data: format(raw.diffs.reply), + color: colors.yellow, }, { name: 'Normal', type: 'area', data: format(raw.diffs.normal), + color: colors.blue, }], }; }; diff --git a/packages/client/src/components/instance-stats.vue b/packages/client/src/components/instance-stats.vue index d2aa5a151..f386a8de9 100644 --- a/packages/client/src/components/instance-stats.vue +++ b/packages/client/src/components/instance-stats.vue @@ -59,7 +59,7 @@ export default defineComponent({ setup() { const chartSpan = ref<'hour' | 'day'>('hour'); - const chartSrc = ref('notes'); + const chartSrc = ref('active-users'); return { chartSrc,