Show tooltip for current_profit

This commit is contained in:
Matthias 2023-05-28 15:51:13 +02:00
parent d5ac4bce16
commit f374939890

View File

@ -128,9 +128,7 @@ function updateChart(initial = false) {
name: 'currentProfit',
animation: initial,
tooltip: {
show: false,
},
lineStyle: {
color: openProfit.value > 0 ? 'green' : 'red',
type: 'dotted',
@ -193,9 +191,14 @@ function initializeChart() {
show: props.showTitle,
},
backgroundColor: 'rgba(0, 0, 0, 0)',
tooltip: {
trigger: 'axis',
formatter: (params) => {
const profit = params[0].data.profit;
const currentProfit = params[0].data['currentProfit'];
const profitText = currentProfit ? `Current Profit: ${currentProfit}` : `Profit: ${profit}`;
return profitText;
},
axisPointer: {
type: 'line',
label: {