Skip to content

Commit a12a7a6

Browse files
Update tooltip
1 parent c384a57 commit a12a7a6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

jQuery/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(() => {
1515
type: 'spline',
1616
argumentField: 'month',
1717
valueField: 'actualSpend',
18-
name: 'Amount Spend',
18+
name: 'Amount Spent',
1919
color: '#cb4bfa',
2020
}],
2121
valueAxis: [{
@@ -30,6 +30,9 @@ $(() => {
3030
tooltip: {
3131
enabled: true,
3232
customizeTooltip(data) {
33+
if (data.seriesName === 'Budget') {
34+
return { text: formatNumber(data.value, 'currency') };
35+
}
3336
const isValueAboveAverage = data.value > averageSpend;
3437
const aboveText = `${formatNumber(data.value, 'currency')}\n${formatNumber(data.value - averageSpend, 'currency')} above average spending.`;
3538
const belowText = `${formatNumber(data.value, 'currency')}\n${formatNumber(averageSpend - data.value, 'currency')} below average spending.`;

0 commit comments

Comments
 (0)