language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | gulpfile.js | @@ -86,7 +86,7 @@ function buildTask() {
function packageTask() {
return merge(
// gather "regular" files landing in the package root
- gulp.src([outDir + '*.js', 'LICENSE.md']),
+ gulp.src([outDir + '*.js', outDir + '*.css', 'LICENSE.md']),
// since we moved the dist files one folder up (... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | package.json | @@ -23,6 +23,7 @@
"url": "https://github.com/chartjs/Chart.js/issues"
},
"devDependencies": {
+ "clean-css": "^4.2.1",
"coveralls": "^3.0.0",
"eslint": "^5.9.0",
"eslint-config-chartjs": "^0.1.0", | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | rollup.config.js | @@ -4,6 +4,7 @@ const commonjs = require('rollup-plugin-commonjs');
const resolve = require('rollup-plugin-node-resolve');
const terser = require('rollup-plugin-terser').terser;
const optional = require('./rollup.plugins').optional;
+const stylesheet = require('./rollup.plugins').stylesheet;
const pkg = require('./... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | rollup.plugins.js | @@ -1,4 +1,6 @@
/* eslint-env es6 */
+const cleancss = require('clean-css');
+const path = require('path');
const UMD_WRAPPER_RE = /(\(function \(global, factory\) \{)((?:\s.*?)*)(\}\(this,)/;
const CJS_FACTORY_RE = /(module.exports = )(factory\(.*?\))( :)/;
@@ -56,6 +58,51 @@ function optional(config = {}) {
};... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | samples/advanced/content-security-policy.css | @@ -0,0 +1,20 @@
+.content {
+ max-width: 640px;
+ margin: auto;
+ padding: 1rem;
+}
+
+.note {
+ font-family: sans-serif;
+ color: #5050a0;
+ line-height: 1.4;
+ margin-bottom: 1rem;
+ padding: 1rem;
+}
+
+code {
+ background-color: #f5f5ff;
+ border: 1px solid #d0d0fa;
+ border-radius: 4px;
+ padding: 0.05rem 0.25rem... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | samples/advanced/content-security-policy.html | @@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'">
+ <title>Scriptable > Bubble |... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | samples/advanced/content-security-policy.js | @@ -0,0 +1,54 @@
+var utils = Samples.utils;
+
+// CSP: disable automatic style injection
+Chart.platform.disableCSSInjection = true;
+
+utils.srand(110);
+
+function generateData() {
+ var DATA_COUNT = 16;
+ var MIN_XY = -150;
+ var MAX_XY = 100;
+ var data = [];
+ var i;
+
+ for (i = 0; i < DATA_COUNT; ++i) {
+ data... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | samples/samples.js | @@ -187,6 +187,9 @@
items: [{
title: 'Progress bar',
path: 'advanced/progress-bar.html'
+ }, {
+ title: 'Content Security Policy',
+ path: 'advanced/content-security-policy.html'
}]
}];
| true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | samples/style.css | @@ -1,4 +1,3 @@
-@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900');
body, html { | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | scripts/deploy.sh | @@ -41,7 +41,7 @@ cd $TARGET_DIR
git checkout $TARGET_BRANCH
# Copy dist files
-deploy_files '../dist/*.js' './dist'
+deploy_files '../dist/*.css ../dist/*.js' './dist'
# Copy generated documentation
deploy_files '../dist/docs/*' './docs' | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | scripts/release.sh | @@ -21,7 +21,7 @@ git remote add auth-origin https://$GITHUB_AUTH_TOKEN@github.com/$TRAVIS_REPO_SL
git config --global user.email "$GITHUB_AUTH_EMAIL"
git config --global user.name "Chart.js"
git checkout --detach --quiet
-git add -f dist/*.js bower.json
+git add -f dist/*.css dist/*.js bower.json
git commit -m "Re... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | src/platforms/platform.dom.css | @@ -0,0 +1,46 @@
+/*
+ * DOM element rendering detection
+ * https://davidwalsh.name/detect-node-insertion
+ */
+@keyframes chartjs-render-animation {
+ from { opacity: 0.99; }
+ to { opacity: 1; }
+}
+
+.chartjs-render-monitor {
+ animation: chartjs-render-animation 0.001s;
+}
+
+/*
+ * DOM element resizing detection
... | true |
Other | chartjs | Chart.js | 55128f74c1518ac82189c0acba2a6b40f77bf698.json | 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.pl... | src/platforms/platform.dom.js | @@ -5,9 +5,11 @@
'use strict';
var helpers = require('../helpers/index');
+var stylesheet = require('./platform.dom.css');
var EXPANDO_KEY = '$chartjs';
var CSS_PREFIX = 'chartjs-';
+var CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';
var CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';
var CSS_RENDER_ANIM... | true |
Other | chartjs | Chart.js | 7c11c81d961751db1499a35e3f163b56d4d65ab1.json | Fix broken markdown link in 'line' docs (#6053) | docs/charts/line.md | @@ -91,7 +91,7 @@ The style of each point can be controlled with the following properties:
| `pointHitRadius` | The pixel size of the non-displayed point that reacts to mouse events.
| `pointRadius` | The radius of the point shape. If set to 0, the point is not rendered.
| `pointRotation` | The rotation of the point... | false |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/axes/README.md | @@ -10,7 +10,7 @@ Scales in Chart.js >v2.0 are significantly more powerful, but also different tha
* Scale titles are supported.
* New scale types can be extended without writing an entirely new chart type.
-# Common Configuration
+## Common Configuration
The following properties are common to all axes provided ... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/axes/cartesian/README.md | @@ -7,7 +7,7 @@ Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes
* [category](./category.md#category-cartesian-axis)
* [time](./time.md#time-cartesian-axis)
-# Common Configuration
+## Common Configuration
All of the included cartesian axes support a number of common options.
@@ ... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/charts/bar.md | @@ -206,7 +206,7 @@ You can also specify the dataset as x/y coordinates when using the [time scale](
data: [{x:'2016-12-25', y:20}, {x:'2016-12-26', y:10}]
```
-# Stacked Bar Chart
+## Stacked Bar Chart
Bar charts can be configured into stacked bar charts by changing the settings on the X and Y axes to enable st... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/charts/line.md | @@ -190,7 +190,7 @@ data: [{
This alternate is used for sparse datasets, such as those in [scatter charts](./scatter.md#scatter-chart). Each data point is specified using an object containing `x` and `y` properties.
-# Stacked Area Chart
+## Stacked Area Chart
Line charts can be configured into stacked area cha... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/developers/README.md | @@ -2,14 +2,14 @@
Developer features allow extending and enhancing Chart.js in many different ways.
-# Latest resources
+## Latest resources
Latest documentation and samples, including unreleased features, are available at:
- https://www.chartjs.org/docs/master/
- https://www.chartjs.org/samples/master/
... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/developers/contributing.md | @@ -9,11 +9,11 @@ New contributions to the library are welcome, but we ask that you please follow
- Avoid breaking changes unless there is an upcoming major release, which are infrequent. We encourage people to write plugins for most new advanced features, and care a lot about backwards compatibility.
- We strongly p... | true |
Other | chartjs | Chart.js | 765c432dfaa1c6472caf9d52926177c48761bd32.json | Fix duplicate anchor (#6038)
* Fix broken documentation anchors
* Revert changes to installation docs | docs/getting-started/installation.md | @@ -17,6 +17,7 @@ bower install chart.js --save
```
## CDN
+
### CDNJS
[](https://cdnjs.com/libraries/Chart.js)
@@ -38,18 +39,18 @@ You can download the latest version of [Chart.js on GitHub](https://github.com/c
If you downloa... | true |
Other | chartjs | Chart.js | 93d5ac9a311282517a03b47ca9b54be7847aef0f.json | Remove unused eslint directive (#6040) | src/scales/scale.time.js | @@ -1,4 +1,3 @@
-/* global window: false */
'use strict';
var adapter = require('../core/core.adapters')._date; | false |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/README.md | @@ -14,11 +14,11 @@ In this example, we create a bar chart for a single dataset and render that in o
```html
<canvas id="myChart" width="400" height="400"></canvas>
<script>
-var ctx = document.getElementById("myChart").getContext('2d');
+var ctx = document.getElementById('myChart').getContext('2d');
var myChart = ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/README.md | @@ -16,9 +16,9 @@ The following properties are common to all axes provided by Chart.js.
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `display` | `Boolean`/`String` | `true` | Controls the axis global visibility (visible when `true`, hidden when `false`). When `display: 'auto'`, the... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/cartesian/README.md | @@ -12,27 +12,27 @@ Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes
All of the included cartesian axes support a number of common options.
| Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `type` | `String` | | Type of scale being employed. Custom scales... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/cartesian/category.md | @@ -2,7 +2,7 @@
If global configuration is used, labels are drawn from one of the label arrays included in the chart data. If only `data.labels` is defined, this will be used. If `data.xLabels` is defined and the axis is horizontal, this will be used. Similarly, if `data.yLabels` is defined and the axis is vertical,... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/cartesian/linear.md | @@ -7,15 +7,15 @@ The linear scale is use to chart numerical data. It can be placed on either the
The following options are provided by the linear scale. They are all located in the `ticks` sub options. These options extend the [common tick configuration](README.md#tick-configuration).
| Name | Type | Default | Des... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/cartesian/logarithmic.md | @@ -7,6 +7,6 @@ The logarithmic scale is use to chart numerical data. It can be placed on either
The following options are provided by the logarithmic scale. They are all located in the `ticks` sub options. These options extend the [common tick configuration](README.md#tick-configuration).
| Name | Type | Default |... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/cartesian/time.md | @@ -8,14 +8,15 @@ The time scale is used to display times and dates. When building its ticks, it w
The x-axis data points may additionally be specified via the `t` or `x` attribute when using the time scale.
- data: [{
- x: new Date(),
- y: 1
- }, {
- t: new Date(),
- y: 10
- }... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/labelling.md | @@ -7,15 +7,15 @@ When creating a chart, you want to tell the viewer what data they are viewing. T
The scale label configuration is nested under the scale configuration in the `scaleLabel` key. It defines options for the scale title. Note that this only applies to cartesian axes.
| Name | Type | Default | Descripti... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/radial/README.md | @@ -2,4 +2,4 @@
Radial axes are used specifically for the radar and polar area chart types. These axes overlay the chart area, rather than being positioned on one of the edges. One radial axis is included by default in Chart.js.
-* [linear](./linear.md#linear-radial-axis)
\ No newline at end of file
+* [linear](./... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/radial/linear.md | @@ -10,28 +10,28 @@ The axis has configuration properties for ticks, angle lines (line that appear i
| Name | Type | Description
| ---- | ---- | -----------
-| `angleLines` | `Object` | Angle line configuration. [more...](#angle-line-options)
-| `gridLines` | `Object` | Grid line configuration. [more...](../styling... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/axes/styling.md | @@ -7,60 +7,60 @@ There are a number of options to allow styling an axis. There are settings to co
The grid line configuration is nested under the scale configuration in the `gridLines` key. It defines options for the grid lines that run perpendicular to the axis.
| Name | Type | Default | Description
-| -----| ---... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/area.md | @@ -8,10 +8,10 @@ Both [line](line.md) and [radar](radar.md) charts support a `fill` option on the
| Mode | Type | Values |
| :--- | :--- | :--- |
-| Absolute dataset index <sup>1</sup> | `Number` | `1`, `2`, `3`, ... |
-| Relative dataset index <sup>1</sup> | `String` | `'-1'`, `'-2'`, `'+1'`, ... |
-| Boundary <s... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/bar.md | @@ -66,19 +66,19 @@ The bar chart allows a number of properties to be specified for each dataset.
These are used to set display properties for a specific dataset. For example,
the color of the bars is generally set this way.
-| Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../ge... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/bubble.md | @@ -19,15 +19,15 @@ A bubble chart is used to display three dimensions of data at the same time. The
}],
"backgroundColor": "rgb(255, 99, 132)"
}]
- },
+ }
}
{% endchartjs %}
## Example Usage
```javascript
// For a bubble chart
-var myBubbleChart = new Chart(ctx,{
+var ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/doughnut.md | @@ -14,26 +14,26 @@ They are also registered under two aliases in the `Chart` core. Other than their
"labels": [
"Red",
"Blue",
- "Yellow",
+ "Yellow"
],
"datasets": [{
"label": "My First Dataset",
"data": [300, 50, 100... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/line.md | @@ -41,35 +41,35 @@ var myLineChart = new Chart(ctx, {
The line chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset. For example, the colour of a line is generally set this way.
-| Name | Type | [Scriptable](../general/options.md#scr... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/mixed.md | @@ -6,67 +6,67 @@ Creating a mixed chart starts with the initialization of a basic chart.
```javascript
var myChart = new Chart(ctx, {
- type: 'bar',
- data: data,
- options: options
+ type: 'bar',
+ data: data,
+ options: options
});
```
At this point we have a standard bar chart. Now we need to c... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/polar.md | @@ -26,7 +26,7 @@ This type of chart is often useful when we want to show a comparison data simila
"rgb(54, 162, 235)"
]
}]
- },
+ }
}
{% endchartjs %}
@@ -46,14 +46,14 @@ The following options can be included in a polar area chart dataset to configure
| Name | Type |... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/radar.md | @@ -64,44 +64,44 @@ var myRadarChart = new Chart(ctx, {
The radar chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset. For example, the colour of a line is generally set this way.
-All point* properties can be specified as an array. ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/charts/scatter.md | @@ -46,4 +46,4 @@ data: [{
x: 15,
y: 10
}]
-```
\ No newline at end of file
+``` | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/README.md | @@ -14,9 +14,9 @@ The following example would set the hover mode to 'nearest' for all charts where
Chart.defaults.global.hover.mode = 'nearest';
// Hover mode is set to nearest because it was not overridden here
-var chartHoverModeNearest = new Chart(ctx, {
+var chartHoverModeNearest = new Chart(ctx, {
type: ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/animations.md | @@ -7,14 +7,15 @@ Chart.js animates charts out of the box. A number of options are provided to con
The following animation options are available. The global options for are defined in `Chart.defaults.global.animation`.
| Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `duration` | `Num... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/elements.md | @@ -11,21 +11,21 @@ Chart.defaults.global.elements.rectangle.borderWidth = 2;
```
## Point Configuration
-Point elements are used to represent the points in a line chart or a bubble chart.
+Point elements are used to represent the points in a line, radar or bubble chart.
Global point options: `Chart.defaults.glo... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/layout.md | @@ -3,11 +3,11 @@
The layout configuration is passed into the `options.layout` namespace. The global options for the chart layout is defined in `Chart.defaults.global.layout`.
| Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `padding` | `Number` or `Object` | `0` | The padding to add ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/legend.md | @@ -6,14 +6,14 @@ The chart legend displays data about the datasets that are appearing on the char
The legend configuration is passed into the `options.legend` namespace. The global options for the chart legend is defined in `Chart.defaults.global.legend`.
| Name | Type | Default | Description
-| -----| ---- | ----... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/title.md | @@ -6,16 +6,16 @@ The chart title defines text to draw at the top of the chart.
The title configuration is passed into the `options.title` namespace. The global options for the chart title is defined in `Chart.defaults.global.title`.
| Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `d... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/configuration/tooltip.md | @@ -5,51 +5,52 @@
The tooltip configuration is passed into the `options.tooltips` namespace. The global options for the chart tooltips is defined in `Chart.defaults.global.tooltips`.
| Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `enabled` | `Boolean` | `true` | Are on-canvas toolti... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/api.md | @@ -1,6 +1,6 @@
# Chart Prototype Methods
-For each chart, there are a set of global prototype methods on the shared `ChartType` which you may find useful. These are available on all charts created with Chart.js, but for the examples, let's use a line chart we've made.
+For each chart, there are a set of global prot... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/axes.md | @@ -1,6 +1,6 @@
# New Axes
-Axes in Chart.js can be individually extended. Axes should always derive from Chart.Scale but this is not a mandatory requirement.
+Axes in Chart.js can be individually extended. Axes should always derive from `Chart.Scale` but this is not a mandatory requirement.
```javascript
let My... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/charts.md | @@ -41,7 +41,7 @@ Dataset controllers must implement the following interface.
// Update the elements in response to new data
// @param reset : if true, put the elements into a reset state so they can animate to their final values
- update: function(reset) {},
+ update: function(reset) {}
}
```
@@ ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/contributing.md | @@ -11,7 +11,7 @@ New contributions to the library are welcome, but we ask that you please follow
# Joining the project
- Active committers and contributors are invited to introduce yourself and request commit access to this project. We have a very active Slack community that you can join [here](https://chartjs-sl... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/plugins.md | @@ -69,7 +69,7 @@ Plugin options are located under the `options.plugins` config and are scoped by
```javascript
var chart = new Chart(ctx, {
- config: {
+ options: {
foo: { ... }, // chart 'foo' option
plugins: {
p1: {
@@ -96,7 +96,7 @@ Chart.plugins.register({
});
... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/developers/updates.md | @@ -40,8 +40,8 @@ function updateConfigByMutating(chart) {
function updateConfigAsNewObject(chart) {
chart.options = {
responsive: true,
- title:{
- display:true,
+ title: {
+ display: true,
text: 'Chart.js'
},
scales: {
@@ -52,7 +52,7 @@... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/accessibility.md | @@ -2,7 +2,7 @@
Chart.js charts are rendered on user provided `canvas` elements. Thus, it is up to the user to create the `canvas` element in a way that is accessible. The `canvas` element has support in all browsers and will render on screen but the `canvas` content will not be accessible to screen readers.
-With... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/colors.md | @@ -25,8 +25,8 @@ img.onload = function() {
backgroundColor: fillPattern
}]
}
- })
-}
+ });
+};
```
Using pattern fills for data graphics can help viewers with vision deficiencies (e.g. color-blindness or partial sight) to [more easily understand your data](http://betwee... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/device-pixel-ratio.md | @@ -10,4 +10,4 @@ Setting `devicePixelRatio` to a value other than 1 will force the canvas size to
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `devicePixelRatio` | `Number` | window.devicePixelRatio | Override the window's default devicePixelRatio.
+| `devicePixelRatio` | `number`... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/fonts.md | @@ -23,9 +23,9 @@ let chart = new Chart(ctx, {
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `defaultFontColor` | `Color` | `'#666'` | Default font color for all text.
-| `defaultFontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Default font family for ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/interactions/README.md | @@ -4,7 +4,7 @@ The hover configuration is passed into the `options.hover` namespace. The global
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `mode` | `String` | `'nearest'` | Sets which elements appear in the tooltip. See [Interaction Modes](./modes.md#interaction-modes) for detai... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/interactions/events.md | @@ -3,9 +3,9 @@ The following properties define how the chart interacts with events.
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `events` | `String[]` | `["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]` | The `events` option defines the browser events tha... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/interactions/modes.md | @@ -16,7 +16,7 @@ var chart = new Chart(ctx, {
mode: 'point'
}
}
-})
+});
```
## nearest
@@ -31,11 +31,11 @@ var chart = new Chart(ctx, {
mode: 'nearest'
}
}
-})
+});
```
## single (deprecated)
-Finds the first item that intersects the point and returns it. ... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/general/responsive.md | @@ -13,15 +13,15 @@ Chart.js provides a [few options](#configuration-options) to enable responsivene
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `responsive` | `Boolean` | `true` | Resizes the chart canvas when its container does ([important note...](#important-note)).
-| `respons... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/getting-started/README.md | @@ -11,7 +11,7 @@ First, we need to have a canvas in our page.
Now that we have a canvas we can use, we need to include Chart.js in our page.
```html
-<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/getting-started/installation.md | @@ -40,7 +40,7 @@ If you download or clone the repository, you must [build](../developers/contribu
# Selecting the Correct Build
-Chart.js provides two different builds for you to choose: `Stand-Alone Build`, `Bundled Build`.
+Chart.js provides two different builds for you to choose: **Stand-Alone Build**, **Bundl... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/getting-started/integration.md | @@ -28,9 +28,9 @@ var myChart = new Chart(ctx, {...});
## Require JS
```javascript
-require(['path/to/chartjs/dist/Chart.js'], function(Chart){
+require(['path/to/chartjs/dist/Chart.js'], function(Chart) {
var myChart = new Chart(ctx, {...});
});
```
-> **Important:** RequireJS [can **not** load CommonJS m... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/getting-started/usage.md | @@ -11,10 +11,10 @@ To create a chart, we need to instantiate the `Chart` class. To do this, we need
```javascript
// Any of the following formats may be used
-var ctx = document.getElementById("myChart");
-var ctx = document.getElementById("myChart").getContext("2d");
-var ctx = $("#myChart");
-var ctx = "myChart"... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/notes/README.md | @@ -1 +1 @@
-# Additional Notes
\ No newline at end of file
+# Additional Notes | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/notes/comparison.md | @@ -9,7 +9,7 @@ Library Features
| SVG | | ✓ | ✓ | ✓ |
| Built-in Charts | ✓ | | ✓ | ✓ |
| 8+ Chart Types | ✓ | ✓ | ✓ | |
-| Extendable to Custom Charts | ✓ | ✓ | | |
+| Extendable to Custom Charts | ✓ | ✓ | | |
| Supports Modern Browser... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/notes/extensions.md | @@ -65,6 +65,6 @@ In addition, many plugins can be found on the [npm registry](https://www.npmjs.c
### Ember.js
- <a href="https://github.com/aomran/ember-cli-chart" target="_blank">ember-cli-chart</a>
-
+
### Omi (v5+)
- <a href="https://github.com/Tencent/omi/tree/master/packages/omi-chart" target="_blank">o... | true |
Other | chartjs | Chart.js | 0d01bcf5cca3a85c97305ad44925113cdead9c74.json | Fix typos and make the docs consistent (#6020) | docs/notes/license.md | @@ -1,3 +1,3 @@
# License
-Chart.js is <a href="https://github.com/chartjs/Chart.js" target="_blank">open source</a> and available under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT license</a>.
\ No newline at end of file
+Chart.js is <a href="https://github.com/chartjs/Chart.js" target="_b... | true |
Other | chartjs | Chart.js | e6a0c8690981de60d789f74e605f6d6b4557e3f6.json | Fix pointBackgroundColor in radar sample (#6013) | samples/charts/radar.html | @@ -102,7 +102,7 @@
label: 'Dataset ' + config.data.datasets.length,
borderColor: newColor,
backgroundColor: color(newColor).alpha(0.2).rgbString(),
- pointBorderColor: newColor,
+ pointBackgroundColor: newColor,
data: [],
};
| false |
Other | chartjs | Chart.js | 8b110fdc513141e99848ae236860741e48cc31ff.json | Handle any element in triggerMouseEvent in tests (#5994) | test/specs/controller.polarArea.tests.js | @@ -281,12 +281,12 @@ describe('Chart.controllers.polarArea', function() {
var chart = this.chart;
var arc = chart.getDatasetMeta(0).data[0];
- jasmine.triggerMouseEvent(chart, 'mousemove', {_model: arc.getCenterPoint()});
+ jasmine.triggerMouseEvent(chart, 'mousemove', arc);
expect(arc._model.backgro... | true |
Other | chartjs | Chart.js | 8b110fdc513141e99848ae236860741e48cc31ff.json | Handle any element in triggerMouseEvent in tests (#5994) | test/utils.js | @@ -106,12 +106,27 @@ function waitForResize(chart, callback) {
};
}
+function _resolveElementPoint(el) {
+ var point = {x: 0, y: 0};
+ if (el) {
+ if (typeof el.getCenterPoint === 'function') {
+ point = el.getCenterPoint();
+ } else if (el.x !== undefined && el.y !== undefined) {
+ point = el;
+ } else if... | true |
Other | chartjs | Chart.js | 7bbf3cab5bb8f2c561d0a81f6408e017d815e54e.json | Return correct label for value type axis (#5920) | src/controllers/controller.bar.js | @@ -173,7 +173,7 @@ module.exports = DatasetController.extend({
_updateElementGeometry: function(rectangle, index, reset) {
var me = this;
var model = rectangle._model;
- var vscale = me.getValueScale();
+ var vscale = me._getValueScale();
var base = vscale.getBasePixel();
var horizontal = vscale.isHori... | true |
Other | chartjs | Chart.js | 7bbf3cab5bb8f2c561d0a81f6408e017d815e54e.json | Return correct label for value type axis (#5920) | src/controllers/controller.horizontalBar.js | @@ -65,14 +65,14 @@ module.exports = BarController.extend({
/**
* @private
*/
- getValueScaleId: function() {
+ _getValueScaleId: function() {
return this.getMeta().xAxisID;
},
/**
* @private
*/
- getIndexScaleId: function() {
+ _getIndexScaleId: function() {
return this.getMeta().yAxisID;
}... | true |
Other | chartjs | Chart.js | 7bbf3cab5bb8f2c561d0a81f6408e017d815e54e.json | Return correct label for value type axis (#5920) | src/core/core.datasetController.js | @@ -131,6 +131,34 @@ helpers.extend(DatasetController.prototype, {
return this.chart.scales[scaleID];
},
+ /**
+ * @private
+ */
+ _getValueScaleId: function() {
+ return this.getMeta().yAxisID;
+ },
+
+ /**
+ * @private
+ */
+ _getIndexScaleId: function() {
+ return this.getMeta().xAxisID;
+ },
+
+ /**
+ ... | true |
Other | chartjs | Chart.js | 7bbf3cab5bb8f2c561d0a81f6408e017d815e54e.json | Return correct label for value type axis (#5920) | src/scales/scale.category.js | @@ -49,12 +49,12 @@ module.exports = Scale.extend({
getLabelForIndex: function(index, datasetIndex) {
var me = this;
- var data = me.chart.data;
- var isHorizontal = me.isHorizontal();
+ var chart = me.chart;
- if (data.yLabels && !isHorizontal) {
- return me.getRightValue(data.datasets[datasetIndex].dat... | true |
Other | chartjs | Chart.js | 7bbf3cab5bb8f2c561d0a81f6408e017d815e54e.json | Return correct label for value type axis (#5920) | test/specs/scale.category.tests.js | @@ -156,35 +156,38 @@ describe('Category scale tests', function() {
expect(scale.ticks).toEqual(labels);
});
- it ('should get the correct label for the index', function() {
- var scaleID = 'myScale';
-
- var mockData = {
- datasets: [{
- yAxisID: scaleID,
- data: [10, 5, 0, 25, 78]
- }],
- labels:... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | src/adapters/adapter.moment.js | @@ -0,0 +1,82 @@
+// TODO v3 - make this adapter external (chartjs-adapter-moment)
+
+'use strict';
+
+var moment = require('moment');
+var adapter = require('../core/core.adapters')._date;
+var helpers = require('../helpers/helpers.core');
+
+var FORMATS = {
+ millisecond: 'h:mm:ss.SSS a',
+ second: 'h:mm:ss a',
+ min... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | src/adapters/index.js | @@ -0,0 +1,10 @@
+'use strict';
+
+// -----------------------------------------------------------------------------
+// IMPORTANT: do NOT submit new adapters to this repository, instead
+// create an external library named `chartjs-adapter-{lib-name}`
+// ----------------------------------------------------------------... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | src/chart.js | @@ -8,6 +8,7 @@ Chart.helpers = require('./helpers/index');
// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!
require('./core/core.helpers')(Chart);
+Chart._adapters = require('./core/core.adapters');
Chart.Animation = require('./core/core.animation');
Chart.animationS... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | src/core/core.adapters.js | @@ -0,0 +1,115 @@
+/**
+ * @namespace Chart._adapters
+ * @since 2.8.0
+ * @private
+ */
+
+'use strict';
+
+function abstract() {
+ throw new Error(
+ 'This method is not implemented: either no adapter can ' +
+ 'be found or an incomplete integration was provided.'
+ );
+}
+
+/**
+ * Date adapter (current used by th... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | src/scales/scale.time.js | @@ -1,7 +1,7 @@
/* global window: false */
'use strict';
-var moment = require('moment');
+var adapter = require('../core/core.adapters')._date;
var defaults = require('../core/core.defaults');
var helpers = require('../helpers/index');
var Scale = require('../core/core.scale');
@@ -178,34 +178,35 @@ function in... | true |
Other | chartjs | Chart.js | 8a3eb8592892965eb6e99750d74ef8000a409976.json | Implement adapter to abstract date/time features (#5960) | test/specs/scale.time.tests.js | @@ -102,17 +102,7 @@ describe('Time scale tests', function() {
isoWeekday: false,
displayFormat: false,
minUnit: 'millisecond',
- displayFormats: {
- millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM
- second: 'h:mm:ss a', // 11:20:01 AM
- minute: 'h:mm a', // 11:20 AM
- hour: 'hA', // ... | true |
Other | chartjs | Chart.js | b50a1c21f2509f54a49347eeb73970a66b3c2013.json | Fix typo / grammar in the responsive docs (#5975) | docs/general/responsive.md | @@ -1,6 +1,6 @@
# Responsive Charts
-When it comes to change the chart size based on the window size, a major limitation is that the canvas *render* size (`canvas.width` and `.height`) can **not** be expressed with relative values, contrary to the *display* size (`canvas.style.width` and `.height`). Furthermore, the... | false |
Other | chartjs | Chart.js | 20c748f90b80c7c1969a9e805a7c0876a19b270b.json | Fix modifying ticks in afterBuildTicks (#5913) | docs/axes/README.md | @@ -31,7 +31,7 @@ There are a number of config callbacks that can be used to change parameters in
| `beforeDataLimits` | `axis` | Callback that runs before data limits are determined.
| `afterDataLimits` | `axis` | Callback that runs after data limits are determined.
| `beforeBuildTicks` | `axis` | Callback that run... | true |
Other | chartjs | Chart.js | 20c748f90b80c7c1969a9e805a7c0876a19b270b.json | Fix modifying ticks in afterBuildTicks (#5913) | src/core/core.scale.js | @@ -196,7 +196,8 @@ module.exports = Element.extend({
// we still support no return (`this.ticks` internally set by calling this method).
ticks = me.buildTicks() || [];
- me.afterBuildTicks();
+ // Allow modification of ticks in callback.
+ ticks = me.afterBuildTicks(ticks) || ticks;
me.beforeTickToLabe... | true |
Other | chartjs | Chart.js | 20c748f90b80c7c1969a9e805a7c0876a19b270b.json | Fix modifying ticks in afterBuildTicks (#5913) | test/specs/core.scale.tests.js | @@ -341,4 +341,99 @@ describe('Core.scale', function() {
});
});
});
+
+ describe('afterBuildTicks', function() {
+ it('should allow filtering of ticks', function() {
+ var labels = ['tick1', 'tick2', 'tick3', 'tick4', 'tick5'];
+ var chart = window.acquireChart({
+ type: 'line',
+ options: {
+ ... | true |
Other | chartjs | Chart.js | f342299845678819c7629e1a569629a8c87ed01a.json | Fix contribution docs about gulp-cli (#5968)
Update the docs so that only gulp-cli is installed globally | docs/developers/contributing.md | @@ -22,7 +22,7 @@ Firstly, we need to ensure development dependencies are installed. With node and
```bash
> npm install
-> npm install -g gulp
+> npm install -g gulp-cli
```
This will install the local development dependencies for Chart.js, along with a CLI for the JavaScript task runner <a href="https://gulpj... | false |
Other | chartjs | Chart.js | c51ac8a64ae743377a594f152cdf50e425d68ac0.json | Make animation duration consistent across browsers (#5331) | src/core/core.animations.js | @@ -14,9 +14,7 @@ defaults._set('global', {
});
module.exports = {
- frameDuration: 17,
animations: [],
- dropFrames: 0,
request: null,
/**
@@ -30,6 +28,8 @@ module.exports = {
var i, ilen;
animation.chart = chart;
+ animation.startTime = Date.now();
+ animation.duration = duration;
if (!lazy... | true |
Other | chartjs | Chart.js | c51ac8a64ae743377a594f152cdf50e425d68ac0.json | Make animation duration consistent across browsers (#5331) | src/core/core.controller.js | @@ -509,22 +509,24 @@ module.exports = function(Chart) {
};
}
- var duration = config.duration;
+ var animationOptions = me.options.animation;
+ var duration = typeof config.duration !== 'undefined'
+ ? config.duration
+ : animationOptions && animationOptions.duration;
var lazy = config.lazy;... | true |
Other | chartjs | Chart.js | c51ac8a64ae743377a594f152cdf50e425d68ac0.json | Make animation duration consistent across browsers (#5331) | test/specs/core.controller.tests.js | @@ -1122,7 +1122,7 @@ describe('Chart', function() {
expect(this.addAnimationSpy).toHaveBeenCalledWith(
this.chart,
jasmine.objectContaining({easing: 'linear'}),
- undefined,
+ 500,
undefined
);
}); | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | src/scales/scale.linear.js | @@ -1,6 +1,5 @@
'use strict';
-var defaults = require('../core/core.defaults');
var helpers = require('../helpers/index');
var scaleService = require('../core/core.scaleService');
var Ticks = require('../core/core.ticks');
@@ -133,20 +132,16 @@ module.exports = function(Chart) {
// Common base implementation ... | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | src/scales/scale.linearbase.js | @@ -16,35 +16,41 @@ function generateTicks(generationOptions, dataRange) {
// for details.
var stepSize = generationOptions.stepSize;
+ var unit = stepSize || 1;
+ var maxNumSpaces = generationOptions.maxTicks - 1;
var min = generationOptions.min;
var max = generationOptions.max;
- var spacing, precision, fac... | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | src/scales/scale.logarithmic.js | @@ -15,10 +15,6 @@ function generateTicks(generationOptions, dataRange) {
var ticks = [];
var valueOrDefault = helpers.valueOrDefault;
- // Figure out what the max number of ticks we can support it is based on the size of
- // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
- // ... | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | src/scales/scale.radialLinear.js | @@ -357,11 +357,9 @@ module.exports = function(Chart) {
// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
me.handleTickRangeOptions();
},
- getTickLimit: function() {
- var opts = this.options;
- var tickOpts = opts.ticks;
- var tickBackdropHeight = getTickBackdropHeight(... | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | test/specs/scale.linear.tests.js | @@ -570,7 +570,7 @@ describe('Linear Scale', function() {
expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
expect(chart.scales.yScale0.min).toBe(1);
expect(chart.scales.yScale0.max).toBe(11);
- expect(chart.scales.yScale0.ticks).toEqual(['11', '9', '7', '5', '3', '1']);
+ expect(chart.s... | true |
Other | chartjs | Chart.js | aae05a08da0e216371caafa17228b3bff97d9fa9.json | Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit | test/specs/scale.radialLinear.tests.js | @@ -282,6 +282,43 @@ describe('Test the radial linear scale', function() {
expect(chart.scale.end).toBe(0);
});
+ it('Should correctly limit the maximum number of ticks', function() {
+ var chart = window.acquireChart({
+ type: 'radar',
+ data: {
+ labels: ['label1', 'label2', 'label3'],
+ datasets: [... | true |
Other | chartjs | Chart.js | 8780aaf3aa4ad04c3cd0e3417d84a48ecdbd773f.json | add missing types to legend (#9226) | types/index.esm.d.ts | @@ -2120,6 +2120,14 @@ export interface LegendOptions {
* @default 'center'
*/
align: 'start' | 'center' | 'end';
+ /**
+ * Maximum height of the legend, in pixels
+ */
+ maxHeight: number;
+ /**
+ * Maximum width of the legend, in pixels
+ */
+ maxWidth: number;
/**
* Marks that this box ... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.