Display the metric's suffix in tooltip.
When we mouseovered on a point on a metric, the value was shown but the suffix wasn't. It was due to a curly bracket issue, the "tooltip" option wasn't given as an "option" sub-object, but as a third argument of the Chart constructor. A curly bracket was closed to early. This is fixed and the suffix is now displayed. Related to CachetHQ/Cachet#2848
This commit is contained in:
2
public/dist/js/all.js
vendored
2
public/dist/js/all.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/js/app.js
vendored
2
public/dist/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -116,7 +116,8 @@ module.exports = {
|
|||||||
if (this.chart !== null) {
|
if (this.chart !== null) {
|
||||||
this.chart.destroy()
|
this.chart.destroy()
|
||||||
}
|
}
|
||||||
|
//Used in tooltip callback where this.metric is not the same.
|
||||||
|
var metric = this.metric;
|
||||||
this.chart = new Chart(this.context, {
|
this.chart = new Chart(this.context, {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
@@ -164,15 +165,14 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
},
|
tooltips: {
|
||||||
tooltips: {
|
callbacks: {
|
||||||
callbacks: {
|
label: function(tooltipItem, data) {
|
||||||
label: function(tooltipItem, data) {
|
return tooltipItem.yLabel + ' ' + metric.suffix;
|
||||||
return tooltipItem.yLabel + ' ' + result.data.metric.suffix
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user