Skip to content

Commit 5acc5e7

Browse files
committed
Clean up tool tips
1 parent 9aaf390 commit 5acc5e7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/trader/http/js/graph.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function render(data) {
157157
labels: {
158158
minWidth: 80,
159159
formatter: function (val) {
160-
if (val == null) return ""
160+
if (val == null) return val
161161
return Number(val.toFixed(8)).toString() // Need to do a custom format of numbers to limit precision
162162
}
163163
}
@@ -295,6 +295,16 @@ function render(data) {
295295
text: title
296296
}
297297

298+
if (chart == "trades" || chart == "volume") {
299+
// Using negative numbers so that they appear below the graph, but they are not really negative
300+
options.tooltip.y = {
301+
formatter: function (val) {
302+
if (val == null) return val
303+
return Number(Math.abs(val).toFixed(8)).toString()
304+
}
305+
}
306+
}
307+
298308
// Create the chart
299309
var div = document.querySelector("#" + chart)
300310
var chart = new ApexCharts(div, options)

0 commit comments

Comments
 (0)