return this.options.position == "top" || this.options.position == "bottom";
},
- getLabelForIndex: function(index, datasetIndex) {
- if (this.isHorizontal()) {
- return this.data.datasets[datasetIndex].label || this.data.labels[index];
- }
- return this.data.datasets[datasetIndex].data[index];
- },
+ // Used to get the value to display in the tooltip for the data at the given index
+ // function getLabelForIndex(index, datasetIndex)
+ getLabelForIndex: helpers.noop,
// Used to get data value locations. Value can either be an index or a numerical value
getPixelForValue: helpers.noop,
this.ticks = this.data.labels;
},
+ getLabelForIndex: function(index, datasetIndex) {
+ return this.ticks[index];
+ },
+
// Used to get data value locations. Value can either be an index or a numerical value
getPixelForValue: function(value, index, datasetIndex, includeOffset) {
this.zeroLineIndex = this.ticks.indexOf(0);
},
+ getLabelForIndex: function(index, datasetIndex) {
+ return this.getRightValue(this.data.datasets[datasetIndex].data[index]);
+ },
+
// Utils
getPixelForValue: function(value, index, datasetIndex, includeOffset) {
// This must be called after fit has been run so that
this.ticks = this.tickValues.slice();
},
+ // Get the correct tooltip label
+ getLabelForIndex: function(index, datasetIndex) {
+ return this.getRightValue(this.data.datasets[datasetIndex].data[index]);
+ },
// Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not
getRightValue: function(rawValue) {
return typeof rawValue === "object" ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;
this.ticks.push(this.firstTick.clone().add(i, this.tickUnit));
}
},
+ // Get tooltip label
+ getLabelForIndex: function(index, datasetIndex) {
+ return this.data.labels[index];
+ },
convertTicksToLabels: function() {
this.ticks = this.ticks.map(function(tick, index, ticks) {
var formattedTick = tick.format(this.options.time.displayFormat ? this.options.time.displayFormat : time.unit[this.tickUnit].display);