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 | 7c3e71d58b6cb4b169ef03ca22f7bf2cfd09b912.json | update copyright date | gulpfile.js | @@ -29,7 +29,7 @@ var header = "/*!\n" +
" * http://chartjs.org/\n" +
" * Version: {{ version }}\n" +
" *\n" +
- " * Copyright 2016 Nick Downie\n" +
+ " * Copyright 2017 Nick Downie\n" +
" * Released under the MIT license\n" +
" * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md\n" +
" */\... | false |
Other | chartjs | Chart.js | 3187a788e17f79ad69da509748aeb64cdbac48f0.json | Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart ins... | src/chart.js | @@ -5,13 +5,13 @@ var Chart = require('./core/core.js')();
require('./core/core.helpers')(Chart);
require('./core/core.canvasHelpers')(Chart);
+require('./core/core.plugin.js')(Chart);
require('./core/core.element')(Chart);
require('./core/core.animation')(Chart);
require('./core/core.controller')(Chart);
requi... | true |
Other | chartjs | Chart.js | 3187a788e17f79ad69da509748aeb64cdbac48f0.json | Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart ins... | src/core/core.controller.js | @@ -258,7 +258,7 @@ module.exports = function(Chart) {
var me = this;
// Before init plugin notification
- Chart.plugins.notify('beforeInit', [me]);
+ Chart.plugins.notify(me, 'beforeInit');
me.bindEvents();
@@ -273,7 +273,7 @@ module.exports = function(Chart) {
me.update();
// After ini... | true |
Other | chartjs | Chart.js | 3187a788e17f79ad69da509748aeb64cdbac48f0.json | Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart ins... | src/core/core.plugin.js | @@ -2,16 +2,31 @@
module.exports = function(Chart) {
- var noop = Chart.helpers.noop;
+ var helpers = Chart.helpers;
+ var noop = helpers.noop;
+
+ Chart.defaults.global.plugins = {};
/**
* The plugin service singleton
* @namespace Chart.plugins
* @since 2.1.0
*/
Chart.plugins = {
+ /**
+ * Gl... | true |
Other | chartjs | Chart.js | 3187a788e17f79ad69da509748aeb64cdbac48f0.json | Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart ins... | test/core.plugin.tests.js | @@ -1,16 +1,13 @@
describe('Chart.plugins', function() {
- var oldPlugins;
-
- beforeAll(function() {
- oldPlugins = Chart.plugins.getAll();
- });
-
- afterAll(function() {
- Chart.plugins.register(oldPlugins);
+ beforeEach(function() {
+ this._plugins = Chart.plugins.getAll();
+ Chart.plugins.clear();
});
- b... | true |
Other | chartjs | Chart.js | 3187a788e17f79ad69da509748aeb64cdbac48f0.json | Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart ins... | test/mockContext.js | @@ -274,6 +274,7 @@
var canvas = document.createElement('canvas');
var chart, key;
+ config = config || {};
options = options || {};
options.canvas = options.canvas || {height: 512, width: 512};
options.wrapper = options.wrapper || {class: 'chartjs-wrapper'}; | true |
Other | chartjs | Chart.js | 152ce9c9f83e3678aee663ee250d7cda06bb3b99.json | Pass the hover event to the onHover event handler (#3669)
Pass the hover event to the onHover event handler
This makes the behavior of the `onHover` handler consistent with the `onClick` handler:
```
function(event, activeElements) {
var chartInstance = this;
}
``` | docs/01-Chart-Configuration.md | @@ -81,7 +81,7 @@ responsive | Boolean | true | Resizes the chart canvas when its container does.
responsiveAnimationDuration | Number | 0 | Duration in milliseconds it takes to animate to new size after a resize event.
maintainAspectRatio | Boolean | true | Maintain the original canvas aspect ratio `(width / height)... | true |
Other | chartjs | Chart.js | 152ce9c9f83e3678aee663ee250d7cda06bb3b99.json | Pass the hover event to the onHover event handler (#3669)
Pass the hover event to the onHover event handler
This makes the behavior of the `onHover` handler consistent with the `onClick` handler:
```
function(event, activeElements) {
var chartInstance = this;
}
``` | src/core/core.controller.js | @@ -796,7 +796,7 @@ module.exports = function(Chart) {
// On Hover hook
if (hoverOptions.onHover) {
- hoverOptions.onHover.call(me, me.active);
+ hoverOptions.onHover.call(me, e, me.active);
}
if (e.type === 'mouseup' || e.type === 'click') { | true |
Other | chartjs | Chart.js | 97f6c8f12d75981ace1df5662f544f0758653170.json | Add rectRounded point style | docs/03-Line-Chart.md | @@ -57,7 +57,7 @@ pointHitRadius | `Number or Array<Number>` | The pixel size of the non-displayed
pointHoverBackgroundColor | `Color or Array<Color>` | Point background color when hovered
pointHoverBorderColor | `Color or Array<Color>` | Point border color when hovered
pointHoverBorderWidth | `Number or Array<Numbe... | true |
Other | chartjs | Chart.js | 97f6c8f12d75981ace1df5662f544f0758653170.json | Add rectRounded point style | docs/05-Radar-Chart.md | @@ -50,7 +50,7 @@ pointHitRadius | `Number or Array<Number>` | The pixel size of the non-displayed
pointHoverBackgroundColor | `Color or Array<Color>` | Point background color when hovered
pointHoverBorderColor | `Color or Array<Color>` | Point border color when hovered
pointHoverBorderWidth | `Number or Array<Numbe... | true |
Other | chartjs | Chart.js | 97f6c8f12d75981ace1df5662f544f0758653170.json | Add rectRounded point style | src/core/core.canvasHelpers.js | @@ -43,6 +43,14 @@ module.exports = function(Chart) {
ctx.fillRect(x - size, y - size, 2 * size, 2 * size);
ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);
break;
+ case 'rectRounded':
+ var offset = radius / Math.SQRT2;
+ var leftX = x - offset;
+ var topY = y - offset;
+ var sideSize = Ma... | true |
Other | chartjs | Chart.js | 97f6c8f12d75981ace1df5662f544f0758653170.json | Add rectRounded point style | test/element.point.tests.js | @@ -208,6 +208,30 @@ describe('Point element tests', function() {
args: []
}]);
+ var drawRoundedRectangleSpy = jasmine.createSpy('drawRoundedRectangle');
+ var drawRoundedRectangle = Chart.helpers.drawRoundedRectangle;
+ var offset = point._view.radius / Math.SQRT2;
+ Chart.helpers.drawRoundedRectangle = ... | true |
Other | chartjs | Chart.js | 7e5e29e3ee15100de599124b4951d50f3aad5f57.json | Improve radial scale (#3625)
Clean up radial linear scale. It now supports multiple lines for point labels. Fixes #3225 | samples/radar/radar.html | @@ -32,7 +32,7 @@
var config = {
type: 'radar',
data: {
- labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
+ labels: [["Eating", "Dinner"], ["Drinking", "Water"], "Sleeping", ["Designing", "Graphics"], "Coding", "Cycling", "Running"],
... | true |
Other | chartjs | Chart.js | 7e5e29e3ee15100de599124b4951d50f3aad5f57.json | Improve radial scale (#3625)
Clean up radial linear scale. It now supports multiple lines for point labels. Fixes #3225 | src/scales/scale.radialLinear.js | @@ -47,10 +47,266 @@ module.exports = function(Chart) {
}
};
+ function getValueCount(scale) {
+ return !scale.options.lineArc ? scale.chart.data.labels.length : 0;
+ }
+
+ function getPointLabelFontOptions(scale) {
+ var pointLabelOptions = scale.options.pointLabels;
+ var fontSize = helpers.getValueOrDefaul... | true |
Other | chartjs | Chart.js | 7e5e29e3ee15100de599124b4951d50f3aad5f57.json | Improve radial scale (#3625)
Clean up radial linear scale. It now supports multiple lines for point labels. Fixes #3225 | test/controller.polarArea.tests.js | @@ -96,9 +96,9 @@ describe('Polar area controller tests', function() {
expect(meta.data.length).toBe(4);
[
- {o: 156, s: -0.5 * Math.PI, e: 0},
- {o: 211, s: 0, e: 0.5 * Math.PI},
- {o: 45, s: 0.5 * Math.PI, e: Math.PI},
+ {o: 168, s: -0.5 * Math.PI, e: 0},
+ {o: 228, s: 0, e: 0.5 * Math.PI},
+ {o: ... | true |
Other | chartjs | Chart.js | 7e5e29e3ee15100de599124b4951d50f3aad5f57.json | Improve radial scale (#3625)
Clean up radial linear scale. It now supports multiple lines for point labels. Fixes #3225 | test/scale.radialLinear.tests.js | @@ -342,9 +342,9 @@ describe('Test the radial linear scale', function() {
}
});
- expect(chart.scale.drawingArea).toBe(225);
- expect(chart.scale.xCenter).toBe(256);
- expect(chart.scale.yCenter).toBe(272);
+ expect(chart.scale.drawingArea).toBe(233);
+ expect(chart.scale.xCenter).toBe(247);
+ expect(cha... | true |
Other | chartjs | Chart.js | 5dd1c77cf51adda1055c2eabb9f064b8ed5ee5ff.json | Take vertical padding into account | src/core/core.layoutService.js | @@ -154,9 +154,11 @@ module.exports = function(Chart) {
helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
- // If a box has padding, we move the left scale over to avoid ugly charts (see issue #2478)
+ // If a horizontal box has padding, we move the left boxes over to avo... | true |
Other | chartjs | Chart.js | 5dd1c77cf51adda1055c2eabb9f064b8ed5ee5ff.json | Take vertical padding into account | src/core/core.scale.js | @@ -51,6 +51,12 @@ module.exports = function(Chart) {
};
Chart.Scale = Chart.Element.extend({
+ /**
+ * Get the padding needed for the scale
+ * @method getPadding
+ * @private
+ * @returns {Padding} the necessary padding
+ */
getPadding: function() {
var me = this;
return { | true |
Other | chartjs | Chart.js | 5dd1c77cf51adda1055c2eabb9f064b8ed5ee5ff.json | Take vertical padding into account | test/scale.logarithmic.tests.js | @@ -722,7 +722,7 @@ describe('Logarithmic Scale tests', function() {
expect(xScale.getPixelForValue(10, 0, 0)).toBeCloseToPixel(276); // halfway
expect(xScale.getPixelForValue(0, 0, 0)).toBeCloseToPixel(48); // 0 is invalid, put it on the left.
- expect(xScale.getValueForPixel(481.5)).toBeCloseTo(80, 1e-4);... | true |
Other | chartjs | Chart.js | b95ba3d5c3c6a7a93a2a2a1b02f550b9c33a288e.json | Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <> | src/helpers/helpers.easing.js | @@ -1,122 +0,0 @@
-import {PI, TAU, HALF_PI} from './helpers.math';
-
-const atEdge = (t) => t === 0 || t === 1;
-const elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));
-const elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;
-
-/**
- * Easing functio... | true |
Other | chartjs | Chart.js | b95ba3d5c3c6a7a93a2a2a1b02f550b9c33a288e.json | Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <> | src/helpers/helpers.easing.ts | @@ -0,0 +1,124 @@
+import {PI, TAU, HALF_PI} from './helpers.math';
+
+const atEdge = (t: number) => t === 0 || t === 1;
+const elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));
+const elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Ma... | true |
Other | chartjs | Chart.js | b95ba3d5c3c6a7a93a2a2a1b02f550b9c33a288e.json | Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <> | src/helpers/types.ts | @@ -5,4 +5,5 @@
// export * from '.';
export * from './helpers.core';
+export * from './helpers.easing';
export * from '../../types/helpers'; | true |
Other | chartjs | Chart.js | b95ba3d5c3c6a7a93a2a2a1b02f550b9c33a288e.json | Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <> | types/helpers/helpers.easing.d.ts | @@ -1,5 +0,0 @@
-import { EasingFunction } from '..';
-
-export type EasingFunctionSignature = (t: number) => number;
-
-export declare const easingEffects: Record<EasingFunction, EasingFunctionSignature>; | true |
Other | chartjs | Chart.js | b95ba3d5c3c6a7a93a2a2a1b02f550b9c33a288e.json | Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <> | types/index.d.ts | @@ -1,13 +1,15 @@
import { DeepPartial, DistributiveArray, UnionToIntersection } from './utils';
import { TimeUnit } from '../src/core/core.adapters';
+import { EasingFunction } from '../src/helpers/helpers.easing';
import { AnimationEvent } from './animation';
import { AnyObject, EmptyObject } from './basic';
i... | true |
Other | chartjs | Chart.js | 74f50df250ba08c47d90c53bc2d590c43d9c95fe.json | Fix broken link (#10640) | docs/configuration/index.md | @@ -23,7 +23,7 @@ Chart type determines the main type of the chart.
### data
-See [Data Structures](../general/data-structures) for details.
+See [Data Structures](../general/data-structures.md) for details.
### options
| false |
Other | chartjs | Chart.js | b0a06d1652888d2491e99a8f658e447461771acf.json | fix filter paramater in package.json (#10614) | package.json | @@ -45,8 +45,8 @@
"build": "rollup -c && npm run emitDeclarations",
"dev": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers chrome --grep",
"dev:ff": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers firefox --grep",
- "docs": "pnpm run build &&... | false |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | docs/axes/_common.md | @@ -7,6 +7,7 @@ Namespace: `options.scales[scaleId]`
| `type` | `string` | | Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart.
| `alignToPixels` | `boolean` | `false` | Align pixel values to device pixels.
| `backgroundC... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | docs/axes/styling.md | @@ -8,14 +8,9 @@ Namespace: `options.scales[scaleId].grid`, it defines options for the grid lines
| Name | Type | Scriptable | Indexable | Default | Description
| ---- | ---- | :-------------------------------: | :-----------------------------: | ------- | -----------
-| `borderColor` | [`Color`](../general/colors.... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | docs/migration/v4-migration.md | @@ -17,6 +17,12 @@ A number of changes were made to the configuration options passed to the `Chart`
* The radialLinear grid indexable and scriptable options don't decrease the index of the specified grid line anymore.
* The `destroy` plugin hook has been removed and replaced with `afterDestroy`.
* Ticks callback on ... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | docs/samples/scale-options/grid.md | @@ -61,16 +61,20 @@ const config = {
},
scales: {
x: {
+ border: {
+ display: BORDER
+ },
grid: {
display: DISPLAY,
- drawBorder: BORDER,
drawOnChartArea: CHART_AREA,
drawTicks: TICKS,
}
},
y: {
+ bo... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | src/core/core.scale.defaults.js | @@ -26,16 +26,19 @@ export function applyScaleDefaults(defaults) {
grid: {
display: true,
lineWidth: 1,
- drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickLength: 8,
tickWidth: (_ctx, options) => options.lineWidth,
tickColor: (_ctx, options) => opt... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | src/core/core.scale.js | @@ -1004,16 +1004,16 @@ export default class Scale extends Element {
const axis = this.axis;
const chart = this.chart;
const options = this.options;
- const {grid, position} = options;
+ const {grid, position, border} = options;
const offset = grid.offset;
const isHorizontal = this.isHori... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | src/scales/scale.radialLinear.js | @@ -264,7 +264,7 @@ function pathRadiusLine(scale, radius, circular, labelCount) {
}
}
-function drawRadiusLine(scale, gridLineOpts, radius, labelCount) {
+function drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {
const ctx = scale.ctx;
const circular = gridLineOpts.circular;
@@ -277,... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.layouts/stacked-boxes-with-weight.js | @@ -19,8 +19,8 @@ module.exports = {
stackWeight: 2,
offset: true,
bounds: 'data',
- grid: {
- borderColor: 'red'
+ border: {
+ color: 'red'
},
ticks: {
autoSkip: false,
@@ -35,8 +35,8 @@ module.exports = {
... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.layouts/stacked-boxes.js | @@ -18,8 +18,8 @@ module.exports = {
stack: '1',
offset: true,
bounds: 'data',
- grid: {
- borderColor: 'red'
+ border: {
+ color: 'red'
},
ticks: {
autoSkip: false,
@@ -33,8 +33,8 @@ module.exports = {
... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/border-behind-elements.js | @@ -22,18 +22,18 @@ module.exports = {
ticks: {
display: false
},
- grid: {
- borderColor: 'red',
- borderWidth: 5
+ border: {
+ color: 'red',
+ width: 5
}
},
x: {
ticks: {
... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/cartesian-axis-border-settings.json | @@ -22,12 +22,14 @@
"min": -100,
"max": 100,
"grid": {
- "borderColor": "blue",
- "borderWidth": 5,
"color": "red",
- "drawBorder": true,
... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/grid/border-over-grid.js | @@ -7,9 +7,11 @@ module.exports = {
position: {y: 0},
min: -10,
max: 10,
+ border: {
+ color: 'black',
+ width: 5
+ },
grid: {
- borderColor: 'black',
- borderWidth: 5,
color: 'lightGray',
... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/grid/colors.js | @@ -14,9 +14,11 @@ module.exports = {
ticks: {
display: false
},
+ border: {
+ color: 'blue',
+ width: 2,
+ },
grid: {
- borderColor: 'blue',
- borderWidth: 2,
color: 'green',
drawTicks:... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/grid/scriptable-borderDash.js | @@ -7,8 +7,10 @@ module.exports = {
position: {y: 0},
min: -10,
max: 10,
+ border: {
+ dash: (ctx) => ctx.index % 2 === 0 ? [6, 3] : [],
+ },
grid: {
- borderDash: (ctx) => ctx.index % 2 === 0 ? [6, 3] : [],
color: 'lightGr... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/label-offset-vertical-axes.json | @@ -15,17 +15,21 @@
"display": false
},
"grid":{
- "display": false,
- "drawBorder": false
+ "display": false
+ },
+ "border": {
+ ... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/tick-drawing.json | @@ -15,9 +15,11 @@
"ticks": {
"display": false
},
+ "border": {
+ "display": false
+ },
"grid":{
"drawOnChartArea": false,
- ... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/tick-override-styles.json | @@ -15,9 +15,12 @@
"ticks": {
"display": false
},
+
+ "border": {
+ "display": false
+ },
"grid":{
"drawOnChartArea": false,
-... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/x-axis-position-center.json | @@ -22,23 +22,28 @@
"axis": "x",
"min": -100,
"max": 100,
+ "border": {
+ "color": "red"
+ },
"grid": {
"color": "red",
- "bord... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/x-axis-position-dynamic.json | @@ -24,9 +24,11 @@
"axis": "x",
"min": -100,
"max": 100,
+ "border": {
+ "color": "red"
+ },
"grid": {
"color": "red",
- "borde... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/y-axis-position-center.json | @@ -22,9 +22,11 @@
"axis": "x",
"min": -100,
"max": 100,
+ "border": {
+ "color": "red"
+ },
"grid": {
"color": "red",
- "borde... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/core.scale/y-axis-position-dynamic.json | @@ -22,9 +22,11 @@
"axis": "x",
"min": -100,
"max": 100,
+ "border": {
+ "color": "red"
+ },
"grid": {
"color": "red",
- "borde... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/scale.radialLinear/border-dash.json | @@ -10,9 +10,11 @@
"r": {
"grid": {
"color": "rgba(0, 0, 255, 0.5)",
- "lineWidth": 1,
- "borderDash": [4, 2],
- "borderDashOffset": 2
+ "lineWidth": 1
+ },
+ "border": {
+ "dash": [4, 2],
+ "dashOffset"... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/scale.radialLinear/circular-border-dash.json | @@ -8,12 +8,14 @@
"responsive": false,
"scales": {
"r": {
+ "border": {
+ "dash": [4, 2],
+ "dashOffset": 2
+ },
"grid": {
"circular": true,
"color": "rgba(0, 0, 255, 0.5)",
- "lineWidth": 1,
- "bor... | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/fixtures/scale.timeseries/financial-daily.js | @@ -46,8 +46,8 @@ module.exports = {
},
y: {
type: 'linear',
- grid: {
- drawBorder: false
+ border: {
+ display: false
}
}
} | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/specs/scale.linear.tests.js | @@ -1119,7 +1119,9 @@ describe('Linear Scale', function() {
type: 'linear',
grid: {
drawTicks: false,
- drawBorder: false
+ },
+ border: {
+ display: false
},
title: {
display: false, | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | test/specs/scale.time.tests.js | @@ -1102,8 +1102,8 @@ describe('Time scale tests', function() {
},
y: {
type: 'linear',
- grid: {
- drawBorder: false
+ border: {
+ display: false
}
}
} | true |
Other | chartjs | Chart.js | 3eb947719e2ac9e3751bf85e262ccf3033649f3d.json | Put the border opts in own object (#10571)
* put borderOpts in own object
* document z option
* remove todo and change scaleId to id
* update some tests
* clean bit, remove console log
* fix failing test
* lint
* Remove comment | types/index.d.ts | @@ -2831,13 +2831,28 @@ export interface PluginChartOptions<TType extends ChartType> {
plugins: PluginOptionsByType<TType>;
}
+export interface BorderOptions {
+ /**
+ * @default true
+ */
+ display: boolean
+ /**
+ * @default []
+ */
+ dash: Scriptable<number[], ScriptableScaleContext>;
+ /**
+ * ... | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/node/package-lock.json | @@ -1,24 +0,0 @@
-{
- "name": "node",
- "lockfileVersion": 2,
- "requires": true,
- "packages": {
- "": {
- "dependencies": {
- "chart.js": "^3.8.2"
- }
- },
- "node_modules/chart.js": {
- "version": "3.8.2",
- "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.8.2.tgz... | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/package.json | @@ -3,9 +3,13 @@
"description": "chart.js should work in react-browser (Web)",
"dependencies": {
"chart.js": "file:../package.tgz",
+ "@types/node": "^18.7.6",
+ "@types/react": "^18.0.17",
+ "@types/react-dom": "^18.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "... | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/src/App.tsx | @@ -1,4 +1,4 @@
-import { useEffect } from 'react';
+import React, {useEffect} from 'react';
import {Chart, DoughnutController, ArcElement} from 'chart.js';
import {merge} from 'chart.js/helpers';
@@ -7,7 +7,9 @@ Chart.register(DoughnutController, ArcElement);
function App() {
useEffect(() => {
const c = C... | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/src/AppAuto.tsx | @@ -0,0 +1,30 @@
+import React, {useEffect} from 'react';
+import Chart from 'chart.js/auto';
+import {merge} from 'chart.js/helpers';
+
+function AppAuto() {
+ useEffect(() => {
+ const c = Chart.getChart('myChart');
+ if (c) {
+ c.destroy();
+ }
+
+ new Chart('myChart', {
+ type: 'doughnut',
+... | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/src/index.js | @@ -1,10 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom/client';
-import App from './App';
-
-const root = ReactDOM.createRoot(document.getElementById('root'));
-root.render(
- <React.StrictMode>
- <App />
- </React.StrictMode>
-); | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/src/index.tsx | @@ -0,0 +1,12 @@
+import React from 'react';
+import {render} from 'react-dom';
+import App from './App';
+import AppAuto from './AppAuto';
+
+render(
+ <React.StrictMode>
+ <App />
+ <AppAuto />
+ </React.StrictMode>,
+ document.getElementById('root')
+); | true |
Other | chartjs | Chart.js | 49b16c967833534b6bad7b1f2b8a0df8f69368ad.json | Change react integration test to TS (#10605)
* switch to ts
* change web integration test to TS
* remove space
* lint things
* one more lint
* Add spaces | test/integration/react-browser/tsconfig.json | @@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "jsx": "react",
+ "target": "ES6",
+ "moduleResolution": "Node",
+ "allowSyntheticDefaultImports": true,
+ "alwaysStrict": true,
+ "strict": true,
+ "noEmit": true
+ },
+ "include": [
+ "./**/*.tsx",
+ ]
+ } | true |
Other | chartjs | Chart.js | d09e424a0a8f17dd290ef898e5709293fb950977.json | Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> | docs/configuration/legend.md | @@ -67,6 +67,8 @@ Namespace: `options.plugins.legend.labels`
| `textAlign` | `string` | `'center'` | Horizontal alignment of the label text. Options are: `'left'`, `'right'` or `'center'`.
| `usePointStyle` | `boolean` | `false` | Label style will match corresponding point style (size is based on pointStyleWidth or t... | true |
Other | chartjs | Chart.js | d09e424a0a8f17dd290ef898e5709293fb950977.json | Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> | docs/migration/v4-migration.md | @@ -17,4 +17,7 @@ A number of changes were made to the configuration options passed to the `Chart`
* If the tooltip callback returns `undefined`, then the default callback will be used.
#### Type changes
-* The order of the `ChartMeta` parameters have been changed from `<Element, DatasetElement, Type>` to `<Type, E... | true |
Other | chartjs | Chart.js | d09e424a0a8f17dd290ef898e5709293fb950977.json | Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> | src/plugins/plugin.legend.js | @@ -278,7 +278,7 @@ export class Legend extends Element {
const defaultColor = defaults.color;
const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
const labelFont = toFont(labelOpts.font);
- const {color: fontColor, padding} = labelOpts;
+ const {padding} = labelOpts;
const fontS... | true |
Other | chartjs | Chart.js | d09e424a0a8f17dd290ef898e5709293fb950977.json | Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> | test/specs/plugin.legend.tests.js | @@ -61,7 +61,7 @@ describe('Legend block tests', function() {
expect(chart.legend.legendItems).toEqual([{
text: 'dataset1',
- borderRadius: 0,
+ borderRadius: undefined,
fillStyle: '#f31',
fontColor: '#666',
hidden: false,
@@ -77,7 +77,7 @@ describe('Legend block tests', fun... | true |
Other | chartjs | Chart.js | d09e424a0a8f17dd290ef898e5709293fb950977.json | Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com> | types/index.d.ts | @@ -2340,6 +2340,18 @@ export interface LegendOptions<TType extends ChartType> {
* @default false
*/
usePointStyle: boolean;
+
+ /**
+ * Label borderRadius will match corresponding borderRadius.
+ * @default false
+ */
+ useBorderRadius: boolean;
+
+ /**
+ * Override the border... | true |
Other | chartjs | Chart.js | d9203719f6ebcd390fb6787a59e7d8424c0126a5.json | add correct padding object to type (#10585)
* add correct padding object to type
* Apply suggestions from code review
Add spacing
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> | types/geometric.d.ts | @@ -35,3 +35,5 @@ export type RoundedRect = {
h: number;
radius?: CornerRadius
}
+
+export type Padding = Partial<TRBL> | number | Point; | true |
Other | chartjs | Chart.js | d9203719f6ebcd390fb6787a59e7d8424c0126a5.json | add correct padding object to type (#10585)
* add correct padding object to type
* Apply suggestions from code review
Add spacing
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> | types/index.d.ts | @@ -5,7 +5,7 @@ import { AnimationEvent } from './animation';
import { AnyObject, EmptyObject } from './basic';
import { Color } from './color';
import { Element } from './element';
-import { ChartArea, Point } from './geometric';
+import { ChartArea, Padding, Point } from './geometric';
import { LayoutItem, Layout... | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | .eslintignore | @@ -1 +1,2 @@
dist/*
+test/integration/react-browser/* | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | test/integration/integration-test.cjs | @@ -7,6 +7,11 @@ const childProcess = require('child_process');
const {describe, it} = require('mocha');
+const platforms = [
+ 'node',
+ 'react-browser'
+];
+
function exec(command, options = {}) {
const output = childProcess.execSync(command, {
encoding: 'utf-8',
@@ -27,7 +32,7 @@ describe('Integratio... | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | test/integration/react-browser/package.json | @@ -0,0 +1,26 @@
+{
+ "private": true,
+ "description": "chart.js should work in react-browser (Web)",
+ "dependencies": {
+ "chart.js": "file:../package.tgz",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-scripts": "5.0.1",
+ "web-vitals": "^2.1.4"
+ },
+ "scripts": {
+ "test": "react... | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | test/integration/react-browser/public/index.html | @@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#000000" />
+ <meta
+ name="description"
+ content="Web site created using create-react-app"
+ />... | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | test/integration/react-browser/src/App.js | @@ -0,0 +1,30 @@
+import { useEffect } from 'react';
+import {Chart, DoughnutController, ArcElement} from 'chart.js';
+import {merge} from 'chart.js/helpers';
+
+Chart.register(DoughnutController, ArcElement);
+
+function App() {
+ useEffect(() => {
+ const c = Chart.getChart('myChart');
+ if(c) c.destroy();
+
+... | true |
Other | chartjs | Chart.js | 1551537a40acb09a9652eae3c3886b5c120008d9.json | Add integration test(s) for Web (#10563)
Adds a basic react integration test | test/integration/react-browser/src/index.js | @@ -0,0 +1,10 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import App from './App';
+
+const root = ReactDOM.createRoot(document.getElementById('root'));
+root.render(
+ <React.StrictMode>
+ <App />
+ </React.StrictMode>
+); | true |
Other | chartjs | Chart.js | e798defcde01bdda13f8ae0a8149859b4c7ce57d.json | Use ESM config file for Rollup (#10564) | rollup.config.js | @@ -1,17 +1,17 @@
-const cleanup = require('rollup-plugin-cleanup');
-const json = require('@rollup/plugin-json');
-const resolve = require('@rollup/plugin-node-resolve').default;
-const terser = require('rollup-plugin-terser').terser;
-const pkg = require('./package.json');
+import cleanup from 'rollup-plugin-cleanup'... | false |
Other | chartjs | Chart.js | b19fc0169facffc2a9a6715d98ccfc3dfba00e09.json | fix: pass timestamp to ticks callback (#10540)
* fix: pass timestamp to ticks callback
* docs: edit labelling page
* docs: additions to the migration guide | docs/axes/labelling.md | @@ -22,7 +22,7 @@ To do this, you need to override the `ticks.callback` method in the axis configu
The method receives 3 arguments:
-* `value` - the tick value in the **internal data format** of the associated scale.
+* `value` - the tick value in the **internal data format** of the associated scale. For time scal... | true |
Other | chartjs | Chart.js | b19fc0169facffc2a9a6715d98ccfc3dfba00e09.json | fix: pass timestamp to ticks callback (#10540)
* fix: pass timestamp to ticks callback
* docs: edit labelling page
* docs: additions to the migration guide | docs/migration/v4-migration.md | @@ -11,6 +11,7 @@ A number of changes were made to the configuration options passed to the `Chart`
#### Specific changes
* The radialLinear grid indexable and scriptable options don't decrease the index of the specified grid line anymore.
+* Ticks callback on time scale now receives timestamp instead of a formatted... | true |
Other | chartjs | Chart.js | b19fc0169facffc2a9a6715d98ccfc3dfba00e09.json | fix: pass timestamp to ticks callback (#10540)
* fix: pass timestamp to ticks callback
* docs: edit labelling page
* docs: additions to the migration guide | src/scales/scale.time.js | @@ -232,6 +232,8 @@ export default class TimeScale extends Scale {
*/
source: 'auto',
+ callback: false,
+
major: {
enabled: false
}
@@ -510,16 +512,21 @@ export default class TimeScale extends Scale {
*/
_tickFormatFunction(time, index, ticks, format) {
const opt... | true |
Other | chartjs | Chart.js | b19fc0169facffc2a9a6715d98ccfc3dfba00e09.json | fix: pass timestamp to ticks callback (#10540)
* fix: pass timestamp to ticks callback
* docs: edit labelling page
* docs: additions to the migration guide | test/specs/scale.time.tests.js | @@ -73,6 +73,7 @@ describe('Time scale tests', function() {
},
ticks: {
source: 'auto',
+ callback: false,
major: {
enabled: false
}
@@ -353,8 +354,8 @@ describe('Time scale tests', function() {
}
},
ticks: {
- ... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | package-lock.json | @@ -47,6 +47,7 @@
"karma-spec-reporter": "0.0.32",
"luxon": "^2.2.0",
"markdown-it-include": "^2.0.0",
+ "mocha": "^10.0.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.34",
"pixelmatch": "^5.2.1",
@@ ... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | package.json | @@ -43,7 +43,9 @@
"lint-types": "eslint \"types/**/*.ts\" && node -r esm types/tests/autogen.js && tsc -p types/tests/",
"lint": "concurrently \"npm:lint-*\"",
"test": "npm run lint && npm run test-ci",
- "test-ci": "cross-env NODE_ENV=test karma start --auto-watch --single-run --cover... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | test/integration/integration-test.js | @@ -0,0 +1,46 @@
+'use strict';
+
+const os = require('os');
+const fs = require('fs-extra');
+const path = require('path');
+const childProcess = require('child_process');
+
+const {describe, it} = require('mocha');
+
+function exec(command, options = {}) {
+ const output = childProcess.execSync(command, {
+ encod... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | test/integration/node/package-lock.json | @@ -0,0 +1,24 @@
+{
+ "name": "node",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "chart.js": "^3.8.2"
+ }
+ },
+ "node_modules/chart.js": {
+ "version": "3.8.2",
+ "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.8.2.tgz... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | test/integration/node/package.json | @@ -0,0 +1,13 @@
+{
+ "private": true,
+ "description": "chart.js should work in Node",
+ "scripts": {
+ "test": "npm run test-cjs",
+ "test-cjs": "node test.cjs",
+ "test-mjs": "node test.mjs",
+ "TODO": "test-mjs should be enambled for chart.js v4"
+ },
+ "dependencies": {
+ "chart.js": "file:../p... | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | test/integration/node/test.cjs | @@ -0,0 +1,7 @@
+const Chart = require('chart.js');
+const valueOrDefault = Chart.helpers.valueOrDefault;
+
+Chart.register({
+ id: 'TEST_PLUGIN',
+ dummyValue: valueOrDefault(0, 1)
+}); | true |
Other | chartjs | Chart.js | 9224e57d93287212ae018745ac629a1d925ba5be.json | Add integration test(s) for Node (#10554) | test/integration/node/test.mjs | @@ -0,0 +1,7 @@
+import {Chart} from 'chart.js';
+import {valueOrDefault} from 'chart.js/helpers';
+
+Chart.register({
+ id: 'TEST_PLUGIN',
+ dummyValue: valueOrDefault(0, 1)
+}); | true |
Other | chartjs | Chart.js | 03e9194be5e899e36ac077d8e33be6921d1eae2a.json | feat: remove line element from scatter controller (#10439)
* feat: remove line element from scatter controller default config
* feat: move common controllers methods to helpers and add types
* feat: mark methods for scatter and line conntrollers as private
* fix: fix error when showline is true at root option... | src/controllers/controller.line.js | @@ -1,7 +1,7 @@
import DatasetController from '../core/core.datasetController';
import {isNullOrUndef} from '../helpers';
-import {_limitValue, isNumber} from '../helpers/helpers.math';
-import {_lookupByKey} from '../helpers/helpers.collection';
+import {isNumber} from '../helpers/helpers.math';
+import {_getStartAn... | true |
Other | chartjs | Chart.js | 03e9194be5e899e36ac077d8e33be6921d1eae2a.json | feat: remove line element from scatter controller (#10439)
* feat: remove line element from scatter controller default config
* feat: move common controllers methods to helpers and add types
* feat: mark methods for scatter and line conntrollers as private
* fix: fix error when showline is true at root option... | src/controllers/controller.scatter.js | @@ -1,7 +1,125 @@
-import LineController from './controller.line';
+import DatasetController from '../core/core.datasetController';
+import {isNullOrUndef} from '../helpers';
+import {isNumber} from '../helpers/helpers.math';
+import {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extra... | true |
Other | chartjs | Chart.js | 03e9194be5e899e36ac077d8e33be6921d1eae2a.json | feat: remove line element from scatter controller (#10439)
* feat: remove line element from scatter controller default config
* feat: move common controllers methods to helpers and add types
* feat: mark methods for scatter and line conntrollers as private
* fix: fix error when showline is true at root option... | src/helpers/helpers.extras.js | @@ -1,3 +1,5 @@
+import {_limitValue} from './helpers.math';
+import {_lookupByKey} from './helpers.collection';
export function fontString(pixelSize, fontStyle, fontFamily) {
return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
@@ -87,3 +89,68 @@ export const _textX = (align, left, right, rtl) => {
const ... | true |
Other | chartjs | Chart.js | 03e9194be5e899e36ac077d8e33be6921d1eae2a.json | feat: remove line element from scatter controller (#10439)
* feat: remove line element from scatter controller default config
* feat: move common controllers methods to helpers and add types
* feat: mark methods for scatter and line conntrollers as private
* fix: fix error when showline is true at root option... | test/specs/controller.scatter.tests.js | @@ -61,4 +61,107 @@ describe('Chart.controllers.scatter', function() {
await jasmine.triggerMouseEvent(chart, 'mousemove', point);
expect(chart.tooltip.body.length).toEqual(1);
});
+
+ it('should not create line element by default', function() {
+ var chart = window.acquireChart({
+ type: 'scatter... | true |
Other | chartjs | Chart.js | 844270eb5ec5d14b1786760fe288bfa0351d9d62.json | feat: pass some chart options to DateAdapter (#10528)
feat: pass some chart options to DateAdapter | src/core/core.adapters.js | @@ -4,6 +4,10 @@
* @private
*/
+/**
+ * @typedef { import("../../types/index.esm").ChartOptions } ChartOptions
+ */
+
/**
* @return {*}
*/
@@ -30,6 +34,13 @@ export class DateAdapter {
this.options = options || {};
}
+ /**
+ * Will called with chart options after adapter creation.
+ * @param {... | true |
Other | chartjs | Chart.js | 844270eb5ec5d14b1786760fe288bfa0351d9d62.json | feat: pass some chart options to DateAdapter (#10528)
feat: pass some chart options to DateAdapter | src/scales/scale.time.js | @@ -223,6 +223,8 @@ export default class TimeScale extends Scale {
const time = scaleOpts.time || (scaleOpts.time = {});
const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);
+ adapter.init(opts);
+
// Backward compatibility: before introducing adapter, `displayFormats` was
... | true |
Other | chartjs | Chart.js | 844270eb5ec5d14b1786760fe288bfa0351d9d62.json | feat: pass some chart options to DateAdapter (#10528)
feat: pass some chart options to DateAdapter | test/specs/scale.time.tests.js | @@ -1235,4 +1235,29 @@ describe('Time scale tests', function() {
});
});
});
+
+ it('should pass chart options to date adapter', function() {
+ let chartOptions;
+
+ Chart._adapters._date.override({
+ init(options) {
+ chartOptions = options;
+ }
+ });
+
+ var chart = window... | true |
Other | chartjs | Chart.js | 844270eb5ec5d14b1786760fe288bfa0351d9d62.json | feat: pass some chart options to DateAdapter (#10528)
feat: pass some chart options to DateAdapter | types/adapters.d.ts | @@ -1,10 +1,17 @@
+import type { ChartOptions } from './index.esm';
+
export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
export interface DateAdapter {
// Override one or multiple of the methods to adjust to the logic of the current date library.
... | true |
Other | chartjs | Chart.js | f0be17c85993aff79db293d6bdf5c7e07f90169f.json | Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info ... | docs/charts/polar.md | @@ -66,6 +66,7 @@ The following options can be included in a polar area chart dataset to configure
| [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
| [`hoverBorderJoinStyle`](#interactions) | `'round'`\|`'bevel'`\|`'miter'` | Yes | Yes | `undefined`
| [`hoverBorderWid... | true |
Other | chartjs | Chart.js | f0be17c85993aff79db293d6bdf5c7e07f90169f.json | Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info ... | docs/configuration/elements.md | @@ -101,3 +101,4 @@ Namespace: `options.elements.arc`, global arc options: `Chart.defaults.elements.
| `borderColor` | [`Color`](/general/colors.md) | `'#fff'` | Arc stroke color.
| `borderJoinStyle` | `'round'`\|`'bevel'`\|`'miter'` | `'bevel'`\|`'round'` | Line join style. See [MDN](https://developer.mozilla.org/en... | true |
Other | chartjs | Chart.js | f0be17c85993aff79db293d6bdf5c7e07f90169f.json | Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info ... | src/elements/element.arc.js | @@ -93,7 +93,7 @@ function rThetaToXY(r, theta, x, y) {
* @param {CanvasRenderingContext2D} ctx
* @param {ArcElement} element
*/
-function pathArc(ctx, element, offset, spacing, end) {
+function pathArc(ctx, element, offset, spacing, end, circular) {
const {x, y, startAngle: start, pixelMargin, innerRadius: in... | true |
Other | chartjs | Chart.js | f0be17c85993aff79db293d6bdf5c7e07f90169f.json | Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info ... | test/specs/element.arc.tests.js | @@ -218,4 +218,36 @@ describe('Arc element tests', function() {
expect(ctx.getCalls().length).toBe(0);
});
+
+ it('should draw when circular: false', function() {
+ var arc = new Chart.elements.ArcElement({
+ startAngle: 0,
+ endAngle: Math.PI * 2,
+ x: 2,
+ y: 2,
+ innerRadius: 0... | true |
Other | chartjs | Chart.js | f0be17c85993aff79db293d6bdf5c7e07f90169f.json | Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info ... | types/index.esm.d.ts | @@ -1746,6 +1746,12 @@ export interface ArcOptions extends CommonElementOptions {
* Arc offset (in pixels).
*/
offset: number;
+
+ /**
+ * If false, Arc will be flat.
+ * @default true
+ */
+ circular: boolean;
}
export interface ArcHoverOptions extends CommonHoverOptions { | true |
Other | chartjs | Chart.js | 1fef75d990ccdb557f19d9be5e67f217d8b5c90d.json | Skip all borders if borderSkipped === true (#10530)
* Skip all borders if borderSkipped === true
This will allow you to skip all borders (not just one side) if you set borderSkipped to boolean true and so allow you to have a consistent legend marker even for bars without borders. Reason is that even if same colored... | docs/charts/bar.md | @@ -74,7 +74,7 @@ Only the `data` option needs to be specified in the dataset namespace.
| [`barPercentage`](#barpercentage) | `number` | - | - | `0.9` |
| [`barThickness`](#barthickness) | `number`\|`string` | - | - | |
| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)... | true |
Other | chartjs | Chart.js | 1fef75d990ccdb557f19d9be5e67f217d8b5c90d.json | Skip all borders if borderSkipped === true (#10530)
* Skip all borders if borderSkipped === true
This will allow you to skip all borders (not just one side) if you set borderSkipped to boolean true and so allow you to have a consistent legend marker even for bars without borders. Reason is that even if same colored... | src/controllers/controller.bar.js | @@ -208,6 +208,11 @@ function setBorderSkipped(properties, options, stack, index) {
return;
}
+ if (edge === true) {
+ properties.borderSkipped = {top: true, right: true, bottom: true, left: true};
+ return;
+ }
+
const {start, end, reverse, top, bottom} = borderProps(properties);
if (edge ===... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.