Skip to content

Open source personal finance application

update 3.4.0

ilkomedc661f91d8e1
diff --git a/assets/stylus/variables/fonts.styl b/assets/stylus/variables/fonts.styl
index 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-serif
fs-m()
font-size 16px
diff --git a/components/dashboard/Dashboard.vue b/components/dashboard/Dashboard.vue
index 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'"
+ )
.chartBlock
DashboardNav
@@ -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
.chartBlock
z-index 10
@@ -120,8 +139,8 @@ export default {
&__tab
position absolute
- left 0
top 0
+ left 0
width 100%
max-width 1100px
padding-bottom 60px
@@ -131,31 +150,31 @@ export default {
padding-top 30px
.startSomething
- padding 100px 0
display flex
- flex-flow column
align-items center
justify-content center
+ padding 100px 0
+ flex-flow column
.options__item
margin-bottom 40px
.options__or
+ position relative
display flex
align-items center
justify-content center
- position relative
padding $m9 0
- text-align center
color var(--c-font-4)
+ text-align center
&__text
position relative
padding $m7
background var(--c-bg-2)
&__border
position absolute
- left 0
top 50%
+ left 0
width 100%
height 1px
background var(--c-bg-6)
diff --git a/components/layout/LayoutPc.vue b/components/layout/LayoutPc.vue
index 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")
Dashboard
diff --git a/components/stat/StatChartBalance.vue b/components/stat/StatChartBalance.vue
index 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.vue
index 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.periods
const trns = this.$store.state.trns.items
const vm = this
// diff periods from oldest trn and today
const 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 : periodsWantToShow
const 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.vue
index 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.js
index 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.js
index 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.js
index 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.json
index 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.js
index 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
}