Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.4.0 #3551

Merged
merged 62 commits into from
Nov 12, 2016
Merged

Version 2.4.0 #3551

merged 62 commits into from
Nov 12, 2016

Conversation

simonbrunel
Copy link
Member

@simonbrunel simonbrunel commented Nov 4, 2016

Milestone: 2.4.0
Merged PRs: 47

Checklist:

See the release process for details.

cc @chartjs/maintainers

panzarino and others added 30 commits September 23, 2016 00:12
Ensure that the hidden iframe is stretched vertically in order to detect height changes. Remove the classlist check/call since it was incorrectly spelled (should be classList), but also useless since the iframe has just been generated. Also remove the callback check: addResizeListener should never be called w/o a valid callback.
Add the --inputs command switch to the unittest and unittestWatch tasks, to be able to run unit tests from the specified files only (e.g. gulp unittest --inputs=test/core.element.tests.js;test/core.helpers.tests.js).
When responsive is false and no canvas height explicitly set, the aspectRatio option wasn't applied because of the canvas default height. Prevent the retinaScale method to change the canvas display size since this method is called for none responsive charts, but instead make the resize() responsible of these changes. Also, as discussed some time ago, moved most of the core.js logic into core.controller.js. Clean up the destroy process and make sure that initial canvas values are properly saved and restored.
Now that the aspect ratio is correctly handled, fix samples for charts with aspect ratio of 1 which was vertically too large. Also fix the default aspect ratio for radar charts which wasn't applied when creating a chart directly using new Chart(ctx, { type: 'radar' }).
CanvasRenderingContext2D.fillText() accepts a fourth parameter called maxWidth that sets the maximum width of the drawn text, enforced by scaling the entire line.

This commit uses the title element's layout dimensions to set maxWidth and avoid overflow outside of the canvas.
Set maxWidth during title draw to avoid overflow
Fix aspect ratio and add responsive unit tests
Improve multiline labeling for tooltips in doughnut charts
Also create a new Chart.Ticks namespace to host common tick generators and formatters.
…ts. (#3361)

Fixes HTML legend string for polar area charts to match doughnut charts
Responsiveness is currently based on the use of an iframe, however this method causes performance issues and could be troublesome when used with ad blockers. So make sure that the user is still able to create a chart without iframe when responsive is false.
In order to simulate real-time chart updates (i.e. horizontal animation), it's necessary to distinguish a removed or added value from a simple update. The dataset controller now hooks array methods that alter the data array length to synchronize metadata accordingly. Also remove the duplicate calls of updateBezierControlPoints() for line and radar charts.
Refactored interaction modes to use lookup functions in Chart.Interaction.modes and added new modes for 'point', 'index', 'nearest', 'x', and 'y'
Fix bubble chart tooltip callback to use correct label parsed from scales. Fixes #3029
etimberg and others added 22 commits October 14, 2016 06:20
Adds new tooltip position option that allows configuring where a tooltip is displayed on the graph in relation to the elements that appear in it
…3471)

Make index mode only work with the horizontal distance to an element if intersect is off
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.
* Add eslint to test files

* Fix mockContext for tests

* Make formatting look better for nested objects
…and bottom.

Re-enabled the layout service tests and then properly disabled the tests that
fail on the CI.
…or custom tooltips.

The custom tooltip sample was updated as well to use the new properties.
Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
…ing colours that should be used by all samples.

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.
Adding a single line to the docs to document autoSkipPadding.
Including: actually, aspect, bottom, changes, characters, datasets, divisible, downward, guidelines, instance, instances, interrupted, item, javascript, label, lifecycle, lines, plugins, manually, milliseconds, nearest, occurring, position, predefined, recalculate, tooltip, those
…ue, we need to do that render with priority over any other renders that take place for animations and tooltips
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.
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}}.
@simonbrunel simonbrunel added this to the Version 2.4 milestone Nov 4, 2016
etimberg and others added 4 commits November 5, 2016 08:19
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.
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.
@simonbrunel simonbrunel merged commit 0515700 into release Nov 12, 2016
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet