Commit Graph

30 Commits

Author SHA1 Message Date
LeeLenaleee
c3fbe5efc3
Fix/area fill and chart titles (#8113)
* fixed fill for area chart stacked and title for charts where it wasn't in plugins yet
* Chart defined in utils
* added radar skip points example in the overview to go to
2020-11-30 09:59:20 -05:00
Laurent Pellegrino
7718d5fd56
Fix broken link (#8041) 2020-11-12 10:52:45 +02:00
Dan Manastireanu
6869a41d40
feat: Draw tooltips with point styles. Closes #7774 (#7972)
* feat: Draw tooltips with point styles. Closes #7774

* chore: Add tooltip usePointStyle docs

* chore: Add tests and visual tests for tooltip usePointStyle

* chore: Update typescript with tooltip usePointStyle
2020-10-29 22:55:40 +02:00
Dan Manastireanu
495c35950c
Add borderRadius to bar charts. Closes #7701 (#7951)
* Add helper to parse border radius options
* feat: Implement borderRadius for bar charts
* chore: add demo of bar charts with border radius
* chore: document bar borderRadius
* chore: update typescript with bar borderRadius property
* fix horizontal borders test failing due to antialiasing
* chore: Add border-radius visual test
2020-10-26 10:05:24 -04:00
Evert Timberg
dc4eac6323
Cartesian axis text alignment (#7846)
* Generate textBaseline per tick label
* Enable configuration of tick alignment
* Add image based tests of text alignment options
2020-10-10 11:38:55 -04:00
Evert Timberg
ef6a0e176c
Add tooltip positioning sample (#7865) 2020-10-09 17:21:34 -04:00
Evert Timberg
a8a83d12cd
Provide APIs to set active (hovered) and tooltip elements. (#7845)
Provide APIs to set active (hovered) and tooltip elements.

Chart.setActiveElements will set the hovered items.
Chart.tooltip.setActiveElements will set the tooltip items.
2020-10-05 17:14:38 -04:00
Jukka Kurkela
bfe34214ac
Use ResizeObserver and MutationObserver to detect detach/attach/resize (#7104)
* Use Resize/MutationObserver to detect detach/attach/resize
* Cleanup
* Review update
* Restore infinite resize detection (#6011)
2020-02-17 11:00:03 -05:00
Ben McCann
9c5a1aabce
Simplify financial sample (#7070) 2020-02-08 08:10:20 -05:00
Ben McCann
47c7a42aae Improved financial sample (#6998)
* Improved financial sample
* Switch from adapter to moment
* Use data instead of cached timestamps
2020-01-26 15:35:53 -05:00
Jukka Kurkela
7eb0c2ca68 Allow specifying spanGaps as number (max distance) (#6993) 2020-01-21 18:33:27 -05:00
Evert Timberg
d04cdfc21f
Add the ability to add a title to the legend (#6906)
* Add the ability to add a title to the legend

- Legend title can be specified
- Font & color options added
- Padding option added
- Positioning option added
- Legend title sample file added
2020-01-10 18:28:51 -05:00
Evert Timberg
eb116fa331
Add multi series pie example (#6919) 2020-01-06 15:04:41 -05:00
Evert Timberg
5f6c3df6dc
Title alignment options (#6908)
* Add alignment options for title plugin.

Alignment can be set to 'start', 'center'. or 'end'. A new sample has been added as well.

* Update sample file title
2020-01-05 14:59:57 -05:00
Jukka Kurkela
b83f64b16e Rewrite animation logic (#6845)
* Rewrite animation logic

* Review update 1

* Review update 2

* Review update 3

* Add 'none' to api.md
2019-12-27 17:13:24 -05:00
Evert Timberg
374b7491a3
Allow axes to be centered on the chart area (#6818)
Allow axes to be centered on the chart area or at a dynamic position based on another axis
2019-12-16 18:17:42 -05:00
Jukka Kurkela
931d686adb Float bars: data as objects (#6739)
Float bars can be specified in object data points
2019-11-15 08:40:45 -05:00
Evert Timberg
2354e2ff6b
Allow functions to be specified for scale grid line options (#6700)
Add scriptable options for scale styling
2019-11-12 07:03:00 -05:00
Evert Timberg
95ba11a427
Add radial and linear gradient sample files (#6666)
* Add radial gradient sample file
* Add linear gradient sample file
2019-11-01 07:20:37 -04:00
jatiny17
ae7a3c27a3 Adding title for the axes (#6571)
Create sample to show how to add an axis title
2019-10-31 18:14:37 -04:00
Jon Rimmer
f3b18373e6 Add onLeave callback to legend (#6059) 2019-02-24 10:58:22 +01:00
Janelle deMent
58d7891ba2 Add examples of scriptable charts (#6042)
* Add example of scriptable pie chart
* Add example of scriptable line chart
* Add example of scriptable polar area chart
* Add example of  scriptable radar chart
2019-02-13 21:12:52 -05:00
Simon Brunel
55128f74c1 Move CSS in a separate file to be CSP-compliant (#6048)
In order to be compatible with any CSP, we need to prevent the automatic creation of the DOM 'style' element and offer our CSS as a separate file that can be manually loaded (`Chart.js` or `Chart.min.js`). Users can now opt-out the style injection using `Chart.platform.disableCSSInjection = true` (note that the style sheet is now injected on the first chart creation).

To prevent duplicating and maintaining the same CSS code at different places, move all these rules in `platform.dom.css` and write a minimal rollup plugin to inject that style as string in `platform.dom.js`. Additionally, this plugin extract the imported style in `./dist/Chart.js` and `./dist/Chart.min.js`.
2019-02-08 19:06:04 +01:00
Simon Brunel
b7139dbbef Use Chart.min.js in samples (#5958)
Samples are supposed to show good practices and in most cases we don't use the time scale but require `Chart.bundle.js`, which is not correct. Instead, we should require the non-bundled version in its minified version (`Chart.min.js`). Paradoxically, time based examples don't use `Chart.bundle.js` but require moment manually side to `Chart.min.js`, which IMO is also the correct way since it allows users to configure and use moment globally (TZ, locales, etc.) and doesn't enforce a specific moment version.

Also remove the `data-labelling.html` example because we now have an [official plugin](https://github.com/chartjs/chartjs-plugin-datalabels) that implements this feature and don't want to deal with user custom code anymore.
2019-01-06 09:56:58 -05:00
Simon Brunel
ae80e14c51
Make bar styling options scriptable (#5780)
The bar `backgroundColor`, `borderColor`, `borderWidth` and `borderSkipped` options are now scriptable (unit tests, docs and a basic sample). Also fix the gulp task that generates the documentation on Windows.
2018-11-12 21:15:37 +01:00
Xingan Wang
333f2eba99 Fix scale options update (#4198)
- allow options to be updated in-place or as a new object
- re-merge new options and rebuild scales & tooltips
- preserve reference to old scale if id/type not changed
- related tests and new sample also added.
- update document about options update
- update doc and example
2017-11-29 22:52:23 +01:00
Ben McCann
fb4357ea91 Add a financial time series sample (#4554) 2017-09-10 10:54:12 +02:00
Simon Brunel
872dfec0f3 Introduce scriptable options (bubble chart) (#4671)
New `options.resolve` helper that determines the final value to use from an array of input values (fallback) and a given context and/or index. For now, only the bubble chart support scriptable options, see documentation for details.

Add scriptable options documentation and update the bubble chart dataset properties table with their scriptable and indexable capabilities and default values. Also move point style description under the element configuration section.
2017-08-24 09:34:38 +02:00
Joe B. Lewis
ecac839f68 Fix broken link to point to correct sample file. 2017-04-15 09:27:27 -04:00
Simon Brunel
6e57405a0a Reorganize samples and list them in index.html (#4043) 2017-03-20 20:40:44 -04:00