mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Expand scale jsdocs (#4736)
This commit is contained in:
parent
ea703a54bf
commit
4396a53041
@ -538,17 +538,33 @@ module.exports = function(Chart) {
|
||||
return rawValue;
|
||||
},
|
||||
|
||||
// Used to get the value to display in the tooltip for the data at the given index
|
||||
// function getLabelForIndex(index, datasetIndex)
|
||||
/**
|
||||
* Used to get the value to display in the tooltip for the data at the given index
|
||||
* @param index
|
||||
* @param datasetIndex
|
||||
*/
|
||||
getLabelForIndex: helpers.noop,
|
||||
|
||||
// Used to get data value locations. Value can either be an index or a numerical value
|
||||
/**
|
||||
* Returns the location of the given data point. Value can either be an index or a numerical value
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param value
|
||||
* @param index
|
||||
* @param datasetIndex
|
||||
*/
|
||||
getPixelForValue: helpers.noop,
|
||||
|
||||
// Used to get the data value from a given pixel. This is the inverse of getPixelForValue
|
||||
/**
|
||||
* Used to get the data value from a given pixel. This is the inverse of getPixelForValue
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param pixel
|
||||
*/
|
||||
getValueForPixel: helpers.noop,
|
||||
|
||||
// Used for tick location, should
|
||||
/**
|
||||
* Returns the location of the tick at the given index
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
*/
|
||||
getPixelForTick: function(index) {
|
||||
var me = this;
|
||||
var offset = me.options.offset;
|
||||
@ -569,7 +585,10 @@ module.exports = function(Chart) {
|
||||
return me.top + (index * (innerHeight / (me._ticks.length - 1)));
|
||||
},
|
||||
|
||||
// Utility for getting the pixel location of a percentage of scale
|
||||
/**
|
||||
* Utility for getting the pixel location of a percentage of scale
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
*/
|
||||
getPixelForDecimal: function(decimal) {
|
||||
var me = this;
|
||||
if (me.isHorizontal()) {
|
||||
@ -583,6 +602,10 @@ module.exports = function(Chart) {
|
||||
return me.top + (decimal * me.height);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the pixel for the minimum chart value
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
*/
|
||||
getBasePixel: function() {
|
||||
return this.getPixelForValue(this.getBaseValue());
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user