Prevent the resize method from notifying plugins if it is a silent resize. A silent resize occurs during startup and we do not want plugins to do anything here because the chart is not set up.
added helper method to adjust the index
pass in chartConfig rather than access within method, make it easier to
test
added semi-colon at the end of helper method
added test for adjustIndex helper method
fixed lint issues
added integration test for the interaction of trigger an event over the
bar
.
.
moved adjustIndex into element helper
removed method from helper and adjusted method in core.interaction
added test for the element adjustIndex helper
added a skipIndexAdjustment method to handle when to skip the adjustment
along with test cases
fixed lint issues
removed the test for the helper method
When datasets.data contains a null value, the label displays incorrect
value.
code additions:
- unit tests for truthy label values (when data is null)
- checks to ensure handling of null value in getLabelByIndex method
added mock data sets from issue #3528 example
expect the return value from getLabelForIndex method to be valid (truthy)
added check for null of first data value in getLabelForIndex
fixed indentation and null comparison operator in code
fixed mistake in definition of firstData variable
changed testing for data on index 0 to using index variable
changed firstData to use value instead
condense the statments to use value variable
The retinaScale helper now enforces the display size to the correct values because if no style has been set on the canvas, the render size is used as display size, making the chart bigger (or smaller) when deviceAspectRatio is different of 1.
In many cases, the canvas render size is changed by the lib, causing the state stack to be discarded, meaning that we can't use save() and restore() to release the context with its initial state (i.e. before creating the chart). Since we don't need (want) to manually save / restore the context initial state, simply make sure to reset it to the default state to give a fresh context back to the user. That also means we don't need to revert the scale when the pixel device ratio is not 1.
When legend is disabled (i.e. {options: {legend: false}}), me.legend is null. Add the same test on me.tooltip even if the tooltip object is always created in case of {options: {tooltips: false}}.
When the iframe is attached to the DOM, its content is reloaded (invaliding the resize listener) so make sure to install the handler after the iframe is loaded. Optimize resize events by throttling resize process until the next animation frame. Rewrite the unit test "waitForResize" method, the previous one (timeout) was too weak and most tests was failing on FF.
I added new samples to explain behaviour and modified all samples to have consistent styling. In updating the samples,
I removed the use of jQuery and instead use standard methods.
For the custom tooltip samples, I updated the styling to show color boxes like the regular tooltips.
Add support for creating a chart from the canvas id and prevent exceptions, at construction time, when the given item doesn't provide a valid CanvasRenderingContext2D or when the getContext API is not accessible (e.g. undefined by add-ons to prevent fingerprinting). New jasmine matcher to verify chart validity.