mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 12:49:07 +02:00
e4dd158b24
Previously, calling getLabelMoment with an out of bound index would cause an error such as this: ``` Uncaught TypeError: Cannot read property 'null' of undefined ``` This happens because there is not always guaranteed to be a labelMoment on at the current datasetIndex. One example of this is practice comes from a this function call: ```js // since the are not always guaranteed to be at least two labelMoments // \ / this index can be out of bounds // | var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6; ``` This patch simply ensures that the `labelMoments` for the `datasetIndex` are defined before accessing properties on it. |
||
---|---|---|
.. | ||
scale.category.js | ||
scale.linear.js | ||
scale.linearbase.js | ||
scale.logarithmic.js | ||
scale.radialLinear.js | ||
scale.time.js |