Skip to content

Commit 26b9d1f

Browse files
authored
Merge pull request #6601 from chartjs/master
Version 2.9.0
2 parents d224e25 + ea100d4 commit 26b9d1f

File tree

326 files changed

+22230
-3826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+22230
-3826
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/gh-pages
77
/jsdoc
88
/node_modules
9-
/package-lock.json
109
.DS_Store
1110
.idea
1211
.project

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ script:
1515
- gulp bower
1616
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls || true
1717

18-
notifications:
19-
slack: chartjs:pcfCZR6ugg5TEcaLtmIfQYuA
20-
2118
sudo: required
2219
dist: trusty
2320

docs/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Summary
22

3-
* [Chart.js](README.md)
3+
* [Chart.js](https://www.chartjs.org)
4+
* [Introduction](README.md)
45
* [Getting Started](getting-started/README.md)
56
* [Installation](getting-started/installation.md)
67
* [Integration](getting-started/integration.md)

docs/axes/cartesian/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ All of the included cartesian axes support a number of common options.
1515
| ---- | ---- | ------- | -----------
1616
| `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.
1717
| `position` | `string` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
18-
| `offset` | `boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` for a category scale in a bar chart by default.
18+
| `offset` | `boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` for a bar chart by default.
1919
| `id` | `string` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
2020
| `gridLines` | `object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
2121
| `scaleLabel` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
@@ -26,6 +26,9 @@ The following options are common to all cartesian axes but do not apply to other
2626

2727
| Name | Type | Default | Description
2828
| ---- | ---- | ------- | -----------
29+
| `min` | `number` | | User defined minimum value for the scale, overrides minimum value from data.
30+
| `max` | `number` | | User defined maximum value for the scale, overrides maximum value from data.
31+
| `sampleSize` | `number` | `ticks.length` | The number of ticks to examine when deciding how many labels will fit. Setting a smaller value will be faster, but may be less accurate when there is large variability in label length.
2932
| `autoSkip` | `boolean` | `true` | If true, automatically calculates how many labels can be shown and hides labels accordingly. Labels will be rotated up to `maxRotation` before skipping any. Turn `autoSkip` off to show all labels no matter what.
3033
| `autoSkipPadding` | `number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled.
3134
| `labelOffset` | `number` | `0` | Distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). *Note: this can cause labels at the edges to be cropped by the edge of the canvas*

docs/axes/cartesian/linear.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ The following options are provided by the linear scale. They are all located in
99
| Name | Type | Default | Description
1010
| ---- | ---- | ------- | -----------
1111
| `beginAtZero` | `boolean` | | if true, scale will include 0 if it is not already included.
12-
| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
13-
| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
1412
| `maxTicksLimit` | `number` | `11` | Maximum number of ticks and gridlines to show.
1513
| `precision` | `number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
1614
| `stepSize` | `number` | | User defined fixed step size for the scale. [more...](#step-size)

docs/axes/cartesian/logarithmic.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@ The logarithmic scale is use to chart numerical data. It can be placed on either
44

55
## Tick Configuration Options
66

7-
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).
8-
9-
| Name | Type | Default | Description
10-
| ---- | ---- | ------- | -----------
11-
| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data.
12-
| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data.
7+
The logarithmic scale options extend the [common tick configuration](README.md#tick-configuration). This scale does not define any options that are unique to it.

docs/axes/cartesian/time.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The time scale is used to display times and dates. When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale.
44

5+
## Date Adapters
6+
7+
The time scale requires both a date library and corresponding adapter to be present. By default, Chart.js includes an adapter for Moment.js. You may wish to [exclude moment](../../getting-started/integration.md) and choose from [other available adapters](https://github.com/chartjs/awesome#adapters) instead.
8+
59
## Data Sets
610

711
### Input Data
@@ -34,8 +38,6 @@ The following options are provided by the time scale. You may also set options p
3438
| `ticks.source` | `string` | `'auto'` | How ticks are generated. [more...](#ticks-source)
3539
| `time.displayFormats` | `object` | | Sets how different time units are displayed. [more...](#display-formats)
3640
| `time.isoWeekday` | `boolean` | `false` | If true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday.
37-
| `time.max` | [Time](#date-formats) | | If defined, this will override the data maximum.
38-
| `time.min` | [Time](#date-formats) | | If defined, this will override the data minimum.
3941
| `time.parser` | <code>string&#124;function</code> | | Custom parser for dates. [more...](#parser)
4042
| `time.round` | `string` | `false` | If defined, dates will be rounded to the start of this unit. See [Time Units](#time-units) below for the allowed units.
4143
| `time.tooltipFormat` | `string` | | The Moment.js format string to use for the tooltip.
@@ -147,7 +149,7 @@ The `ticks.source` property controls the ticks generation.
147149

148150
* `'auto'`: generates "optimal" ticks based on scale size and time options
149151
* `'data'`: generates ticks from data (including labels from data `{t|x|y}` objects)
150-
* `'labels'`: generates ticks from user given `data.labels` values ONLY
152+
* `'labels'`: generates ticks from user given `labels` ONLY
151153

152154
### Parser
153155
If this property is defined as a string, it is interpreted as a custom format to be used by Moment.js to parse the date.

docs/axes/labelling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ var chart = new Chart(ctx, {
4242
}
4343
});
4444
```
45+
46+
The third parameter passed to the callback function is an array of labels, but in the time scale, it is an array of `{label: string, major: boolean}` objects.

docs/axes/radial/linear.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ let options = {
8888

8989
## Angle Line Options
9090

91-
The following options are used to configure angled lines that radiate from the center of the chart to the point labels. They can be found in the `angleLines` sub options. Note that these options only apply if `angleLines.display` is true.
91+
The following options are used to configure angled lines that radiate from the center of the chart to the point labels. They can be found in the `angleLines` sub options.
9292

9393
| Name | Type | Default | Description
9494
| ---- | ---- | ------- | -----------
@@ -100,10 +100,11 @@ The following options are used to configure angled lines that radiate from the c
100100

101101
## Point Label Options
102102

103-
The following options are used to configure the point labels that are shown on the perimeter of the scale. They can be found in the `pointLabels` sub options. Note that these options only apply if `pointLabels.display` is true.
103+
The following options are used to configure the point labels that are shown on the perimeter of the scale. They can be found in the `pointLabels` sub options.
104104

105105
| Name | Type | Default | Description
106106
| ---- | ---- | ------- | -----------
107+
| `display` | `boolean` | `true` | if true, point labels are shown.
107108
| `callback` | `function` | | Callback function to transform data labels to point labels. The default implementation simply returns the current string.
108109
| `fontColor` | <code>Color&#124;Color[]</code> | `'#666'` | Font color for point labels.
109110
| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family to use when rendering labels.

docs/axes/styling.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ The grid line configuration is nested under the scale configuration in the `grid
2222
| `zeroLineColor` | `Color` | `'rgba(0, 0, 0, 0.25)'` | Stroke color of the grid line for the first index (index 0).
2323
| `zeroLineBorderDash` | `number[]` | `[]` | Length and spacing of dashes of the grid line for the first index (index 0). See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
2424
| `zeroLineBorderDashOffset` | `number` | `0.0` | Offset for line dashes of the grid line for the first index (index 0). See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
25-
| `offsetGridLines` | `boolean` | `false` | If true, grid lines will be shifted to be between labels. This is set to `true` for a category scale in a bar chart by default.
25+
| `offsetGridLines` | `boolean` | `false` | If true, grid lines will be shifted to be between labels. This is set to `true` for a bar chart by default.
26+
| `z` | `number` | `0` | z-index of gridline layer. Values &lt;= 0 are drawn under datasets, &gt; 0 on top.
2627

2728
## Tick Configuration
2829
The tick configuration is nested under the scale configuration in the `ticks` key. It defines options for the tick marks that are generated by the axis.
2930

3031
| Name | Type | Default | Description
3132
| ---- | ---- | ------- | -----------
3233
| `callback` | `function` | | Returns the string representation of the tick value as it should be displayed on the chart. See [callback](../axes/labelling.md#creating-custom-tick-formats).
33-
| `display` | `boolean` | `true` | If true, show tick marks.
34+
| `display` | `boolean` | `true` | If true, show tick labels.
3435
| `fontColor` | `Color` | `'#666'` | Font color for tick labels.
3536
| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
3637
| `fontSize` | `number` | `12` | Font size for the tick labels.
@@ -40,6 +41,7 @@ The tick configuration is nested under the scale configuration in the `ticks` ke
4041
| `minor` | `object` | `{}` | Minor ticks configuration. Omitted options are inherited from options above.
4142
| `major` | `object` | `{}` | Major ticks configuration. Omitted options are inherited from options above.
4243
| `padding` | `number` | `0` | Sets the offset of the tick labels from the axis
44+
| `z` | `number` | `0` | z-index of tick layer. Useful when ticks are drawn on chart area. Values &lt;= 0 are drawn under datasets, &gt; 0 on top.
4345

4446
## Minor Tick Configuration
4547
The minorTick configuration is nested under the ticks configuration in the `minor` key. It defines options for the minor tick marks that are generated by the axis. Omitted options are inherited from `ticks` configuration.

0 commit comments

Comments
 (0)