Skip to content

Commit c799775

Browse files
committed
Added ability to format value via "extras.formatted"
1 parent 5bc8537 commit c799775

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

resources/js/columnChart.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ const columnChart = () => {
9191
fill: {
9292
opacity: component.get('columnChartModel.opacity') || 0.5
9393
},
94+
95+
tooltip: {
96+
y: {
97+
formatter: function(value, series) {
98+
return data[series.dataPointIndex].extras.formatted || value;
99+
}
100+
}
101+
},
94102
};
95103

96104
const colors = component.get('columnChartModel.colors');

resources/js/lineChart.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ const lineChart = () => {
9696
}
9797
)
9898
},
99+
100+
tooltip: {
101+
y: {
102+
formatter: function(value, series) {
103+
return data[series.dataPointIndex].extras.formatted || value;
104+
}
105+
}
106+
},
99107
};
100108

101109
this.chart = new ApexCharts(this.$refs.container, options);

resources/js/pieChart.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ const pieChart = () => {
7373
],
7474

7575
legend: component.get('pieChartModel.legend') || {},
76+
77+
tooltip: {
78+
y: {
79+
formatter: function(value, series) {
80+
return data[series.dataPointIndex].extras.formatted || value;
81+
}
82+
}
83+
},
7684
};
7785

7886
const colors = component.get('pieChartModel.colors');

0 commit comments

Comments
 (0)