Skip to content

Open source personal finance application

fix (chart): fix selection

ilkome647c5fbd120e
diff --git a/components/chart/StatChartLines.vue b/components/chart/StatChartLines.vue
index 6bcaa05e..a109f2c5 100644
--- a/components/chart/StatChartLines.vue
+++ b/components/chart/StatChartLines.vue
@@ -68,9 +68,9 @@ export default {
return
const nEvent = await chart.pointer.normalize(event)
- let value = chart.series[0].searchPoint(nEvent, true) || chart.series[0].searchPoint(nEvent, false) || chart.series[1].searchPoint(nEvent, true)
+ let value = chart.series[0].searchPoint(nEvent, true) || chart.series[1].searchPoint(nEvent, true) || chart.series[2].searchPoint(nEvent, true)
setTimeout(() => {
- value = chart.series[0].searchPoint(nEvent, true) || chart.series[0].searchPoint(nEvent, false) || chart.series[1].searchPoint(nEvent, true)
+ value = chart.series[0].searchPoint(nEvent, true) || chart.series[1].searchPoint(nEvent, true) || chart.series[2].searchPoint(nEvent, true)
if (value) {
if (store.state.filter.period === 'all')
@@ -292,7 +292,10 @@ export default {
<template lang="pug">
.chart(@click="onClickChart")
- Chart(:options="chartData" :callback="chartCallback")
+ Chart(
+ :options="chartData"
+ :callback="chartCallback"
+ )
</template>
<style lang="stylus" scoped>
diff --git a/components/chart/Total.vue b/components/chart/Total.vue
index e3fcbae0..b8844d2a 100644
--- a/components/chart/Total.vue
+++ b/components/chart/Total.vue
@@ -38,11 +38,11 @@ export default {
.chart
.chart__content
LazyChartStatChartLines(
- :isShowIncomes="activeTabStat === 'incomes' || activeTabStat === 'details' || activeTabStat === 'history'"
- :isShowExpenses="activeTabStat === 'expenses' || activeTabStat === 'details' || activeTabStat === 'history'"
:categoryId="filter.categoryId"
:chartColor="filter.categoryId && $store.state.categories.items[filter.categoryId].color"
:chartType="chartType"
+ :isShowExpenses="activeTabStat === 'expenses' || activeTabStat === 'details' || activeTabStat === 'history'"
+ :isShowIncomes="activeTabStat === 'incomes' || activeTabStat === 'details' || activeTabStat === 'history'"
)
</template>