include count in chart

This commit is contained in:
jackstar12
2023-06-21 22:37:57 +02:00
parent 7f3ce61f4c
commit 3dd773e229

View File

@ -345,13 +345,15 @@ window.LNbits = {
previous.income.push(current.income) previous.income.push(current.income)
previous.spending.push(current.spending) previous.spending.push(current.spending)
previous.cumulative.push(current.balance) previous.cumulative.push(current.balance)
previous.count.push(current.count)
return previous return previous
}, },
{ {
labels: [], labels: [],
income: [], income: [],
spending: [], spending: [],
cumulative: [] cumulative: [],
count: []
} }
) )
@ -368,7 +370,8 @@ window.LNbits = {
borderColor: '#673ab7', borderColor: '#673ab7',
borderWidth: 4, borderWidth: 4,
pointRadius: 3, pointRadius: 3,
fill: false fill: false,
yAxisID: 'balance'
}, },
{ {
data: data.income, data: data.income,
@ -378,7 +381,8 @@ window.LNbits = {
backgroundColor: window backgroundColor: window
.Color('rgb(76,175,80)') .Color('rgb(76,175,80)')
.alpha(0.5) .alpha(0.5)
.rgbString() // green .rgbString(), // green
yAxisID: 'balance'
}, },
{ {
data: data.spending, data: data.spending,
@ -388,7 +392,19 @@ window.LNbits = {
backgroundColor: window backgroundColor: window
.Color('rgb(233,30,99)') .Color('rgb(233,30,99)')
.alpha(0.5) .alpha(0.5)
.rgbString() // pink .rgbString(), // pink
yAxisID: 'balance'
},
{
data: data.count,
type: 'bar',
label: 'count',
barPercentage: 0.75,
backgroundColor: window
.Color('rgb(33,30,209)')
.alpha(0.5)
.rgbString(), // blue
yAxisID: 'count'
} }
] ]
}, },
@ -411,6 +427,23 @@ window.LNbits = {
stepSize: 3 stepSize: 3
} }
} }
],
yAxes: [
{
id: 'balance',
type: 'linear',
position: 'left'
},
{
id: 'changes',
type: 'linear',
position: 'right'
},
{
id: 'count',
type: 'linear',
position: 'right'
}
] ]
}, },
// performance tweaks // performance tweaks