mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-02-01 17:47:09 +00:00
Small chores (#6740)
* Remove duplicate code * Migrate `xLabel` and `yLabel` from docs & samples
This commit is contained in:
parent
76a89f0922
commit
4feaea925f
@ -136,7 +136,7 @@ var chart = new Chart(ctx, {
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
label += Math.round(tooltipItem.yLabel * 100) / 100;
|
||||
label += Math.round(tooltipItem.value * 100) / 100;
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
if (tooltip.dataPoints.length > 0) {
|
||||
tooltip.dataPoints.forEach(function(dataPoint) {
|
||||
var content = [dataPoint.xLabel, dataPoint.yLabel].join(': ');
|
||||
var content = [dataPoint.label, dataPoint.value].join(': ');
|
||||
var $tooltip = $('#tooltip-' + dataPoint.datasetIndex);
|
||||
|
||||
$tooltip.html(content);
|
||||
|
||||
@ -15,13 +15,6 @@ module.exports = Scale.extend({
|
||||
return first === -1 || first !== last ? index : first;
|
||||
},
|
||||
|
||||
_parseObject: function(obj, axis, index) {
|
||||
if (obj[axis] !== undefined) {
|
||||
return this._parse(obj[axis], index);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
determineDataLimits: function() {
|
||||
var me = this;
|
||||
var max = me._getLabels().length - 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user