Open source personal finance application
update 3.4.0
ilkomedc661f91d8e1
diff --git a/assets/stylus/variables/fonts.styl b/assets/stylus/variables/fonts.stylindex 536dc3ae..31d1fdfc 100644--- a/assets/stylus/variables/fonts.styl+++ b/assets/stylus/variables/fonts.styl@@ -1,5 +1,6 @@html--font-secondary 'Unica One', 'Roboto Condensed', sans-serif+ --font-roboto 'Roboto', sans-seriffs-m()font-size 16pxdiff --git a/components/dashboard/Dashboard.vue b/components/dashboard/Dashboard.vueindex 9a33e010..d20bf752 100644--- a/components/dashboard/Dashboard.vue+++ b/components/dashboard/Dashboard.vue@@ -15,6 +15,14 @@ export default {return true}return false+ },++ periods () {+ return this.$store.state.chart.periods+ },++ filterPeriod () {+ return this.$store.state.filter.period}}}@@ -23,7 +31,11 @@ export default {<template lang="pug">.dashboard(v-show="$store.state.ui.activeTab === 'stat'").dashboard__wrap(v-if="$store.state.ui.statGraphsVisibility === 'visible'")- StatChartsLine+ .dashboard__chart+ StatChartLines(+ v-if="filterPeriod !== 'all'"+ :chartType="periods[filterPeriod].grouped ? 'column' : 'line'"+ ).chartBlockDashboardNav@@ -98,7 +110,14 @@ export default {</template><style lang="stylus" scoped>-@import "~assets/stylus/variables"+@import '~assets/stylus/variables'++.dashboard__chart+ opacity .8+ padding $m7 0++ &:hover+ opacity 1.chartBlockz-index 10@@ -120,8 +139,8 @@ export default {&__tabposition absolute- left 0top 0+ left 0width 100%max-width 1100pxpadding-bottom 60px@@ -131,31 +150,31 @@ export default {padding-top 30px.startSomething- padding 100px 0display flex- flex-flow columnalign-items centerjustify-content center+ padding 100px 0+ flex-flow column.options__itemmargin-bottom 40px.options__or+ position relativedisplay flexalign-items centerjustify-content center- position relativepadding $m9 0- text-align centercolor var(--c-font-4)+ text-align center&__textposition relativepadding $m7background var(--c-bg-2)&__borderposition absolute- left 0top 50%+ left 0width 100%height 1pxbackground var(--c-bg-6)diff --git a/components/layout/LayoutPc.vue b/components/layout/LayoutPc.vueindex 141648d3..b4ec9112 100644--- a/components/layout/LayoutPc.vue+++ b/components/layout/LayoutPc.vue@@ -34,7 +34,8 @@ export default {LayoutPcSidebar.layout__item- //- ThemeEditor+ //- Dashboard+ //------------------------------------------------transition(name="animation-tab")Dashboarddiff --git a/components/stat/StatChartBalance.vue b/components/stat/StatChartBalance.vueindex 6f2ba1f7..28051340 100644--- a/components/stat/StatChartBalance.vue+++ b/components/stat/StatChartBalance.vue@@ -68,7 +68,6 @@ export default {},chart: {- tooltip: false,backgroundColor: 'transparent',with: '100%',height: '40%',@@ -145,23 +144,32 @@ export default {return {series: [{- visible: true,- type: 'areaspline',- name: 'Balance',- color: '#c1c1c1',- data: totalData- }, {visible: true,type: 'spline',name: 'Incomes',color: 'var(--c-incomes-1)',- data: incomesData+ data: incomesData,+ marker: {+ lineColor: 'var(--c-incomes-1)'+ }}, {visible: true,type: 'spline',name: 'Expenses',color: 'var(--c-expenses-1)',- data: expensesData+ data: expensesData,+ marker: {+ lineColor: 'var(--c-expenses-1)'+ }+ }, {+ visible: true,+ type: 'areaspline',+ name: 'Balance',+ color: '#c1c1c1',+ data: totalData,+ marker: {+ lineColor: '#c1c1c1'+ }}],categories}diff --git a/components/stat/StatChartLines.vue b/components/stat/StatChartLines.vueindex ade8be87..da81e0aa 100644--- a/components/stat/StatChartLines.vue+++ b/components/stat/StatChartLines.vue@@ -44,13 +44,15 @@ export default {computed: {chartData () {const periodName = this.$store.state.filter.period+ const chartPeriods = this.$store.state.chart.periodsconst trns = this.$store.state.trns.itemsconst vm = this// diff periods from oldest trn and todayconst oldestTrnDate = this.$day(trns[this.$store.getters['trns/firstCreatedTrnId']].date).endOf(periodName)let periodsToShow = this.$day().endOf(periodName).diff(oldestTrnDate, periodName) + 1- periodsToShow = this.$store.state.chart.periods[periodName].showedPeriods >= periodsToShow ? periodsToShow : this.$store.state.chart.periods[periodName].showedPeriods+ const periodsWantToShow = chartPeriods[periodName].grouped ? chartPeriods[periodName].showedGroups : chartPeriods[periodName].showedPeriods+ periodsToShow = periodsWantToShow >= periodsToShow ? periodsToShow : periodsWantToShowconst categories = []const incomesData = []@@ -180,7 +182,6 @@ export default {chart: {...chartOptions.chart,height: '200',- tooltip: false,events: {click (e) {@@ -205,7 +206,7 @@ export default {}},- tooltip: false+ tooltip: this.$store.state.ui.pc ? chartOptions.tooltip : false}}}diff --git a/components/stat/chart/ChartMenu.vue b/components/stat/chart/ChartMenu.vueindex b6b80689..1101546f 100644--- a/components/stat/chart/ChartMenu.vue+++ b/components/stat/chart/ChartMenu.vue@@ -71,24 +71,24 @@ ContextMenu(template(slot="content")template(v-if="filterPeriod !== 'year'")ContextMenuItem(- icon="mdi mdi-ungroup"+ :icon="periods[filterPeriod].grouped ? 'mdi mdi-chart-bar' : 'mdi mdi-chart-line'":title="periods[filterPeriod].grouped ? $t('chart.view.groupedTitle') : $t('chart.view.simpleTitle')"@onClick="toogleChartsView")ContextMenuItem(icon="mdi mdi-plus"- :title="periods[filterPeriod].grouped ? $t('chart.view.addGroupButton') : $t('chart.view.addPeriodButton')"+ :title="$t('chart.view.addPeriodButton')"@onClick="addPeriodOrGroup")ContextMenuItem(v-if="(periods[filterPeriod].grouped && periods[filterPeriod].showedGroups > 1) || (!periods[filterPeriod].grouped && periods[filterPeriod].showedPeriods > 1)"icon="mdi mdi-minus"- :title="periods[filterPeriod].grouped ? $t('chart.view.removeGroupButton') : $t('chart.view.removePeriodButton')"+ :title="$t('chart.view.removePeriodButton')"@onClick="removePeriodOrGroup")template(slot="desc")- template(v-if="periods[filterPeriod].grouped") {{ $t('chart.view.showed') }} {{ periods[filterPeriod].showedGroups }} {{ $t('chart.view.groupsName') }}+ template(v-if="periods[filterPeriod].grouped") {{ $t('chart.view.showed') }} {{ periods[filterPeriod].showedGroups }} {{ $t('chart.view.periodsName') }}template(v-else) {{ $t('chart.view.showed') }} {{ periods[filterPeriod].showedPeriods }} {{ $t('chart.view.periodsName') }}</template>diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.jsindex 9ee0e450..016b63fb 100644--- a/components/stat/chartOptions.js+++ b/components/stat/chartOptions.js@@ -38,10 +38,7 @@ export default {groupPadding: 0.2,pointPadding: 0.1,borderWidth: 0,- column: {- borderRadiusTopLeft: 5,- borderRadiusTopRight: 5- }+ maxPointWidth: 10},spline: {@@ -130,15 +127,16 @@ export default {shadow: false,style: {color: 'var(--c-font-2)',- fontSize: '10px'- },- positioner (labelWidth, labelHeight, point) {- const leftHalf = point.plotX < (this.chart.plotWidth / 2)- const topHalf = point.plotY < (this.chart.plotHeight / 2)- return {- x: leftHalf ? this.chart.plotLeft + this.chart.plotWidth - labelWidth - 2 : this.chart.plotLeft,- y: topHalf ? this.chart.plotTop + this.chart.plotHeight - labelHeight : this.chart.plotTop- }+ fontSize: '12px',+ fontFamily: 'var(--font-roboto)'}+ // positioner (labelWidth, labelHeight, point) {+ // const leftHalf = point.plotX < (this.chart.plotWidth / 2)+ // const topHalf = point.plotY < (this.chart.plotHeight / 2)+ // return {+ // x: leftHalf ? this.chart.plotLeft + this.chart.plotWidth - labelWidth - 2 : this.chart.plotLeft,+ // y: topHalf ? this.chart.plotTop + this.chart.plotHeight - labelHeight : this.chart.plotTop+ // }+ // }}}diff --git a/locales/en-US.js b/locales/en-US.jsindex cc5c9130..7127792e 100644--- a/locales/en-US.js+++ b/locales/en-US.js@@ -228,8 +228,8 @@ export default {showed: 'Showed',groupsName: 'groups',periodsName: 'periods',- simpleTitle: 'Simple chart',- groupedTitle: 'Griuped chart',+ simpleTitle: 'Line chart',+ groupedTitle: 'Column chart',addGroupButton: 'Add group',addPeriodButton: 'Add period',removeGroupButton: 'Remove group',diff --git a/locales/ru-RU.js b/locales/ru-RU.jsindex 756540bf..37bfa0f5 100644--- a/locales/ru-RU.js+++ b/locales/ru-RU.js@@ -230,8 +230,8 @@ export default {showed: 'Показано',groupsName: 'групп',periodsName: 'период',- simpleTitle: 'Простой график',- groupedTitle: 'График с группами',+ simpleTitle: 'График линия',+ groupedTitle: 'График колонки',addGroupButton: 'Добавить группу',addPeriodButton: 'Добавить период',removeGroupButton: 'Удалить группу',diff --git a/package.json b/package.jsonindex 15e402f1..bd9cdda7 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "finapp",- "version": "3.3.9",+ "version": "3.4.0","scripts": {"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt","build": "nuxt build",diff --git a/store/chart/index.js b/store/chart/index.jsindex 0883fa01..f001beb6 100644--- a/store/chart/index.js+++ b/store/chart/index.js@@ -10,25 +10,25 @@ const state = () => ({periods: {day: {groupedBy: 'month',- showedGroups: 1,+ showedGroups: 14,showedPeriods: 14,grouped: false},week: {groupedBy: 'month',- showedGroups: 3,+ showedGroups: 6,showedPeriods: 6,grouped: false},month: {groupedBy: 'year',- showedGroups: 1,+ showedGroups: 6,showedPeriods: 6,grouped: false},year: {groupedBy: 'year',- showedGroups: 2,+ showedGroups: 3,showedPeriods: 3,grouped: false}