mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +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. |
||
---|---|---|
.. | ||
controller.bar.tests.js | ||
controller.bubble.tests.js | ||
controller.doughnut.tests.js | ||
controller.line.tests.js | ||
controller.polarArea.tests.js | ||
controller.radar.tests.js | ||
core.element.tests.js | ||
core.helpers.tests.js | ||
core.layoutService.tests.js | ||
core.legend.tests.js | ||
core.plugin.tests.js | ||
core.scaleService.tests.js | ||
core.title.tests.js | ||
core.tooltip.tests.js | ||
defaultConfig.tests.js | ||
element.arc.tests.js | ||
element.line.tests.js | ||
element.point.tests.js | ||
element.rectangle.tests.js | ||
mockContext.js | ||
scale.category.tests.js | ||
scale.linear.tests.js | ||
scale.logarithmic.tests.js | ||
scale.radialLinear.tests.js | ||
scale.time.tests.js |