diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-23 15:21:55 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-23 15:21:55 +0900 |
| commit | 052e667f0357a059dd17f46ccce68d2598146724 (patch) | |
| tree | 75226d51850fef5630446478b6fe70bafba67818 /packages/client/src/components | |
| parent | 13.0.0-alpha.6 (diff) | |
| download | misskey-052e667f0357a059dd17f46ccce68d2598146724.tar.gz misskey-052e667f0357a059dd17f46ccce68d2598146724.tar.bz2 misskey-052e667f0357a059dd17f46ccce68d2598146724.zip | |
enhance(client): enhance dashboard of control panel
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/MkChart.vue | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/packages/client/src/components/MkChart.vue b/packages/client/src/components/MkChart.vue index d97b114f17..fbbc231b88 100644 --- a/packages/client/src/components/MkChart.vue +++ b/packages/client/src/components/MkChart.vue @@ -38,6 +38,7 @@ import gradient from 'chartjs-plugin-gradient'; import * as os from '@/os'; import { defaultStore } from '@/store'; import { useChartTooltip } from '@/scripts/use-chart-tooltip'; +import { chartVLine } from '@/scripts/chart-vline'; const props = defineProps({ src: { @@ -311,27 +312,7 @@ const render = () => { gradient, }, }, - plugins: [{ - id: 'vLine', - beforeDraw(chart, args, options) { - if (chart.tooltip?._active?.length) { - const activePoint = chart.tooltip._active[0]; - const ctx = chart.ctx; - const x = activePoint.element.x; - const topY = chart.scales.y.top; - const bottomY = chart.scales.y.bottom; - - ctx.save(); - ctx.beginPath(); - ctx.moveTo(x, bottomY); - ctx.lineTo(x, topY); - ctx.lineWidth = 1; - ctx.strokeStyle = vLineColor; - ctx.stroke(); - ctx.restore(); - } - }, - }], + plugins: [chartVLine(vLineColor)], }); }; |