]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix typos and make the docs consistent (#6020)
authorAkihiko Kusanagi <nagi@nagi-p.com>
Tue, 29 Jan 2019 12:34:16 +0000 (20:34 +0800)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Tue, 29 Jan 2019 12:34:16 +0000 (13:34 +0100)
49 files changed:
docs/README.md
docs/axes/README.md
docs/axes/cartesian/README.md
docs/axes/cartesian/category.md
docs/axes/cartesian/linear.md
docs/axes/cartesian/logarithmic.md
docs/axes/cartesian/time.md
docs/axes/labelling.md
docs/axes/radial/README.md
docs/axes/radial/linear.md
docs/axes/styling.md
docs/charts/area.md
docs/charts/bar.md
docs/charts/bubble.md
docs/charts/doughnut.md
docs/charts/line.md
docs/charts/mixed.md
docs/charts/polar.md
docs/charts/radar.md
docs/charts/scatter.md
docs/configuration/README.md
docs/configuration/animations.md
docs/configuration/elements.md
docs/configuration/layout.md
docs/configuration/legend.md
docs/configuration/title.md
docs/configuration/tooltip.md
docs/developers/api.md
docs/developers/axes.md
docs/developers/charts.md
docs/developers/contributing.md
docs/developers/plugins.md
docs/developers/updates.md
docs/general/accessibility.md
docs/general/colors.md
docs/general/device-pixel-ratio.md
docs/general/fonts.md
docs/general/interactions/README.md
docs/general/interactions/events.md
docs/general/interactions/modes.md
docs/general/responsive.md
docs/getting-started/README.md
docs/getting-started/installation.md
docs/getting-started/integration.md
docs/getting-started/usage.md
docs/notes/README.md
docs/notes/comparison.md
docs/notes/extensions.md
docs/notes/license.md

index fe0b60c5342a7670efc283b7c80047dd9558bcc3..d0b0544ab0c3f24eef14e3e201cc39923669bc8d 100644 (file)
@@ -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 = new Chart(ctx, {
     type: 'bar',
     data: {
-        labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
+        labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
         datasets: [{
             label: '# of Votes',
             data: [12, 19, 3, 5, 2, 3],
@@ -31,7 +31,7 @@ var myChart = new Chart(ctx, {
                 'rgba(255, 159, 64, 0.2)'
             ],
             borderColor: [
-                'rgba(255,99,132,1)',
+                'rgba(255, 99, 132, 1)',
                 'rgba(54, 162, 235, 1)',
                 'rgba(255, 206, 86, 1)',
                 'rgba(75, 192, 192, 1)',
@@ -45,7 +45,7 @@ var myChart = new Chart(ctx, {
         scales: {
             yAxes: [{
                 ticks: {
-                    beginAtZero:true
+                    beginAtZero: true
                 }
             }]
         }
index ba408409e0cd3966f049f8af0996537604859dc6..5761603ba31b053ceb574ceafeffe2f85a49e03f 100644 (file)
@@ -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 axis is visible only if at least one associated dataset is visible.
-| `callbacks` | `Object` | | Callback functions to hook into the axis lifecycle. [more...](#callbacks)
-| `weight` | `Number` | `0` | The weight used to sort the axis. Higher weights are further away from the chart area.
+| `display` | <code>boolean&#124;string</code> | `true` | Controls the axis global visibility (visible when `true`, hidden when `false`). When `display: 'auto'`, the axis is visible only if at least one associated dataset is visible.
+| `callbacks` | `object` | | Callback functions to hook into the axis lifecycle. [more...](#callbacks)
+| `weight` | `number` | `0` | The weight used to sort the axis. Higher weights are further away from the chart area.
 
 ## Callbacks
 There are a number of config callbacks that can be used to change parameters in the scale at different points in the update process.
index 3a052206d800c065d742297c246402b2cbc6506b..a12245a44bc696a5f016e59526f5b0db1d14bf67 100644 (file)
@@ -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 can be created and registered with a string key. This allows changing the type of an axis for a chart.
-| `position` | `String` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
-| `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.
-| `id` | `String` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
-| `gridLines` | `Object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
-| `scaleLabel` | `Object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
-| `ticks` | `Object` | | Tick configuration. [more...](#tick-configuration)
+| ---- | ---- | ------- | -----------
+| `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.
+| `position` | `string` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
+| `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.
+| `id` | `string` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
+| `gridLines` | `object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
+| `scaleLabel` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
+| `ticks` | `object` | | Tick configuration. [more...](#tick-configuration)
 
 ## Tick Configuration
 The following options are common to all cartesian axes but do not apply to other axes.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `autoSkip` | `Boolean` | `true` | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what.
-| `autoSkipPadding` | `Number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled. *Note: Only applicable to horizontal scales.*
-| `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*
-| `maxRotation` | `Number` | `90` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
-| `minRotation` | `Number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
-| `mirror` | `Boolean` | `false` | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.*
-| `padding` | `Number` | `10` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
+| ---- | ---- | ------- | -----------
+| `autoSkip` | `boolean` | `true` | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what.
+| `autoSkipPadding` | `number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled. *Note: Only applicable to horizontal scales.*
+| `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*
+| `maxRotation` | `number` | `90` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
+| `minRotation` | `number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
+| `mirror` | `boolean` | `false` | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.*
+| `padding` | `number` | `10` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
 
 ## Axis ID
 The properties `dataset.xAxisID` or `dataset.yAxisID` have to match the scale properties `scales.xAxes.id` or `scales.yAxes.id`. This is especially needed if multi-axes charts are used.
@@ -84,7 +84,7 @@ var myChart = new Chart(ctx, {
             label: 'Right dataset',
 
             // This binds the dataset to the right y axis
-            yAxisID: 'right-y-axis',
+            yAxisID: 'right-y-axis'
         }],
         labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
     },
index 4bfb6f627cc624ea330773588692384e87509d1e..690b712f5c3a5ae045b05da6500c18f10418eb20 100644 (file)
@@ -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, this property will be used. Using both `xLabels` and `yLabels` together can create a chart that uses strings for both the X and Y axes.
 
-Specifying any of the settings above defines the x axis as `type: category` if not defined otherwise. For more fine-grained control of category labels it is also possible to add `labels` as part of the category axis definition. Doing so does not apply the global defaults.
+Specifying any of the settings above defines the x axis as `type: 'category'` if not defined otherwise. For more fine-grained control of category labels it is also possible to add `labels` as part of the category axis definition. Doing so does not apply the global defaults.
 
 ## Category Axis Definition
 
@@ -14,7 +14,7 @@ let chart = new Chart(ctx, {
     data: {
         labels: ['January', 'February', 'March', 'April', 'May', 'June'],
         datasets: ...
-    },
+    }
 });
 ```
 As part of axis definition:
@@ -27,7 +27,7 @@ let chart = new Chart(ctx, {
         scales: {
             xAxes: [{
                 type: 'category',
-                labels: ['January', 'February', 'March', 'April', 'May', 'June'],
+                labels: ['January', 'February', 'March', 'April', 'May', 'June']
             }]
         }
     }
@@ -39,10 +39,10 @@ let chart = new Chart(ctx, {
 The category scale provides the following options for configuring tick marks. They are nested in the `ticks` sub object. These options extend the [common tick configuration](README.md#tick-configuration).
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `labels` | `Array[String]` | - | An array of labels to display.
-| `min` | `String` | | The minimum item to display. [more...](#min-max-configuration)
-| `max` | `String` | | The maximum item to display. [more...](#min-max-configuration)
+| ---- | ---- | ------- | -----------
+| `labels` | `string[]` | - | An array of labels to display.
+| `min` | `string` | | The minimum item to display. [more...](#min-max-configuration)
+| `max` | `string` | | The maximum item to display. [more...](#min-max-configuration)
 
 ## Min Max Configuration
 For both the `min` and `max` properties, the value must be in the `labels` array. In the example below, the x axis would only display "March" through "June".
@@ -54,7 +54,7 @@ let chart = new Chart(ctx, {
         datasets: [{
             data: [10, 20, 30, 40, 50, 60]
         }],
-        labels: ['January', 'February', 'March', 'April', 'May', 'June'],
+        labels: ['January', 'February', 'March', 'April', 'May', 'June']
     },
     options: {
         scales: {
index 3f68b79ff1daa0b21edbe15f469721c5e16e02ed..ad82c552a9518ab551d64aa2e07c3a4b091c47d2 100644 (file)
@@ -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 | Description
-| -----| ---- | --------| -----------
-| `beginAtZero` | `Boolean` | | if true, scale will include 0 if it is not already included.
-| `min` | `Number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
-| `max` | `Number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
-| `maxTicksLimit` | `Number` | `11` | Maximum number of ticks and gridlines to show.
-| `precision` | `Number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
-| `stepSize` | `Number` | | User defined fixed step size for the scale. [more...](#step-size)
-| `suggestedMax` | `Number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
-| `suggestedMin` | `Number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
+| ---- | ---- | ------- | -----------
+| `beginAtZero` | `boolean` | | if true, scale will include 0 if it is not already included.
+| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
+| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
+| `maxTicksLimit` | `number` | `11` | Maximum number of ticks and gridlines to show.
+| `precision` | `number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
+| `stepSize` | `number` | | User defined fixed step size for the scale. [more...](#step-size)
+| `suggestedMax` | `number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
+| `suggestedMin` | `number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
 
 ## Axis Range Settings
 
@@ -56,7 +56,7 @@ let chart = new Chart(ctx, {
 In contrast to the `suggested*` settings, the `min` and `max` settings set explicit ends to the axes. When these are set, some data points may not be visible.
 
 ## Step Size
- If set, the scale ticks will be enumerated by multiple of stepSize, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
+If set, the scale ticks will be enumerated by multiple of `stepSize`, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
 
 This example sets up a chart with a y axis that creates ticks at `0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5`.
 
@@ -72,4 +72,4 @@ let options = {
         }]
     }
 };
-```
\ No newline at end of file
+```
index 207c55024306d9c06967610930827b8d1be0ad4b..4878f6bee7f776d13ddac59171cc6b232b31afa7 100644 (file)
@@ -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 | Description
-| -----| ---- | --------| -----------
-| `min` | `Number` | | User defined minimum number for the scale, overrides minimum value from data.
-| `max` | `Number` | | User defined maximum number for the scale, overrides maximum value from data.
\ No newline at end of file
+| ---- | ---- | ------- | -----------
+| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data.
+| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data.
index db03a5639c185bef7bd06ffeac5768165c4a4d28..6349af4fcb4773e031d4f2e9fa12f4d7ad3d15c4 100644 (file)
@@ -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
-    }]
-
+```javascript
+data: [{
+    x: new Date(),
+    y: 1
+}, {
+    t: new Date(),
+    y: 10
+}]
+```
 
 ### Date Formats
 
@@ -26,34 +27,34 @@ When providing data for the time scale, Chart.js supports all of the formats tha
 The following options are provided by the time scale. You may also set options provided by the [common tick configuration](README.md#tick-configuration).
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `distribution` | `String` | `linear` | How data is plotted. [more...](#scale-distribution)
-| `bounds` | `String` | `data` | Determines the scale bounds. [more...](#scale-bounds)
-| `ticks.source` | `String` | `auto` | How ticks are generated. [more...](#ticks-source)
-| `time.displayFormats` | `Object` | | Sets how different time units are displayed. [more...](#display-formats)
-| `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.
+| ---- | ---- | ------- | -----------
+| `distribution` | `string` | `'linear'` | How data is plotted. [more...](#scale-distribution)
+| `bounds` | `string` | `'data'` | Determines the scale bounds. [more...](#scale-bounds)
+| `ticks.source` | `string` | `'auto'` | How ticks are generated. [more...](#ticks-source)
+| `time.displayFormats` | `object` | | Sets how different time units are displayed. [more...](#display-formats)
+| `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.
 | `time.max` | [Time](#date-formats) | | If defined, this will override the data maximum.
 | `time.min` | [Time](#date-formats) | | If defined, this will override the data minimum.
-| `time.parser` | `String/Function` | | Custom parser for dates. [more...](#parser)
-| `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.
-| `time.tooltipFormat` | `String` | | The moment js format string to use for the tooltip.
-| `time.unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#time-units) section below for details.
-| `time.stepSize` | `Number` | `1` | The number of units between grid lines.
-| `time.minUnit` | `String` | `'millisecond'` | The minimum display format to be used for a time unit.
+| `time.parser` | <code>string&#124;function</code> | | Custom parser for dates. [more...](#parser)
+| `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.
+| `time.tooltipFormat` | `string` | | The Moment.js format string to use for the tooltip.
+| `time.unit` | `string` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#time-units) section below for details.
+| `time.stepSize` | `number` | `1` | The number of units between grid lines.
+| `time.minUnit` | `string` | `'millisecond'` | The minimum display format to be used for a time unit.
 
 ### Time Units
 
 The following time measurements are supported. The names can be passed as strings to the `time.unit` config option to force a certain unit.
 
-* millisecond
-* second
-* minute
-* hour
-* day
-* week
-* month
-* quarter
-* year
+* `'millisecond'`
+* `'second'`
+* `'minute'`
+* `'hour'`
+* `'day'`
+* `'week'`
+* `'month'`
+* `'quarter'`
+* `'year'`
 
 For example, to create a chart with a time scale that always displayed units per month, the following config could be used.
 
@@ -71,25 +72,25 @@ var chart = new Chart(ctx, {
             }]
         }
     }
-})
+});
 ```
 
 ### Display Formats
-The following display formats are used to configure how different time units are formed into strings for the axis tick marks. See [moment.js](https://momentjs.com/docs/#/displaying/format/) for the allowable format strings.
+The following display formats are used to configure how different time units are formed into strings for the axis tick marks. See [Moment.js](https://momentjs.com/docs/#/displaying/format/) for the allowable format strings.
 
 Name | Default | Example
 --- | --- | ---
-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' | 11AM
-day | 'MMM D' | Sep 4
-week | 'll' | Sep 4 2015
-month | 'MMM YYYY' | Sep 2015
-quarter | '[Q]Q - YYYY' | Q3 - 2015
-year | 'YYYY' | 2015
-
-For example, to set the display format for the 'quarter' unit to show the month and year, the following config would be passed to the chart constructor.
+`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'` | `'11AM'`
+`day` | `'MMM D'` | `'Sep 4'`
+`week` | `'ll'` | `'Sep 4 2015'`
+`month` | `'MMM YYYY'` | `'Sep 2015'`
+`quarter` | `'[Q]Q - YYYY'` | `'Q3 - 2015'`
+`year` | `'YYYY'` | `'2015'`
+
+For example, to set the display format for the `quarter` unit to show the month and year, the following config would be passed to the chart constructor.
 
 ```javascript
 var chart = new Chart(ctx, {
@@ -107,15 +108,15 @@ var chart = new Chart(ctx, {
             }]
         }
     }
-})
+});
 ```
 
 ### Scale Distribution
 
 The `distribution` property controls the data distribution along the scale:
 
-  * `'linear'`: data are spread according to their time (distances can vary)
-  * `'series'`: data are spread at the same distance from each other
+* `'linear'`: data are spread according to their time (distances can vary)
+* `'series'`: data are spread at the same distance from each other
 
 ```javascript
 var chart = new Chart(ctx, {
@@ -129,15 +130,15 @@ var chart = new Chart(ctx, {
             }]
         }
     }
-})
+});
 ```
 
 ### Scale Bounds
 
-The `bounds` property controls the scale boundary strategy (bypassed by min/max time options).
+The `bounds` property controls the scale boundary strategy (bypassed by `min`/`max` time options).
 
-* `'data'`: make sure data are fully visible, labels outside are removed
-* `'ticks'`: make sure ticks are fully visible, data outside are truncated
+* `'data'`: makes sure data are fully visible, labels outside are removed
+* `'ticks'`: makes sure ticks are fully visible, data outside are truncated
 
 ### Ticks Source
 
@@ -148,6 +149,6 @@ The `ticks.source` property controls the ticks generation.
 * `'labels'`: generates ticks from user given `data.labels` values ONLY
 
 ### Parser
-If this property is defined as a string, it is interpreted as a custom format to be used by moment to parse the date.
+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.
 
-If this is a function, it must return a moment.js object given the appropriate data value.
+If this is a function, it must return a Moment.js object given the appropriate data value.
index c185c2ca6775c0e28f502459a3cacb9a0a6658aa..8f39235640fa6e3b843806029308aa3d98d2e1e1 100644 (file)
@@ -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 | Description
-| -----| ---- | --------| -----------
-| `display` | `Boolean` | `false` | If true, display the axis title.
-| `labelString` | `String` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
+| ---- | ---- | ------- | -----------
+| `display` | `boolean` | `false` | If true, display the axis title.
+| `labelString` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
 | `fontColor` | `Color` | `'#666'` | Font color for scale title.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the scale title, follows CSS font-family options.
-| `fontSize` | `Number` | `12` | Font size for scale title.
-| `fontStyle` | `String` | `'normal'` | Font style for the scale title, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-| `padding` | `Number/Object` | `4` | Padding to apply around scale labels. Only `top` and `bottom` are implemented.
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the scale title, follows CSS font-family options.
+| `fontSize` | `number` | `12` | Font size for scale title.
+| `fontStyle` | `string` | `'normal'` | Font style for the scale title, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
+| `padding` | <code>number&#124;object</code> | `4` | Padding to apply around scale labels. Only `top` and `bottom` are implemented.
 
 ## Creating Custom Tick Formats
 
index 64ebe82057c3645653a508daa17d320356242e1d..8a07a4241fba6305ecf0405cc75e38c663a92fd9 100644 (file)
@@ -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](./linear.md#linear-radial-axis)
index 92f1e35b78afb85c315bd0444b2de5c3d87accd5..af1674aa51817d560ee2dbbdb62fa0cbdb741dbb 100644 (file)
@@ -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.md#grid-line-configuration)
-| `pointLabels` | `Object` | Point label configuration. [more...](#point-label-options)
-| `ticks` | `Object` | Tick configuration. [more...](#tick-options)
+| `angleLines` | `object` | Angle line configuration. [more...](#angle-line-options)
+| `gridLines` | `object` | Grid line configuration. [more...](../styling.md#grid-line-configuration)
+| `pointLabels` | `object` | Point label configuration. [more...](#point-label-options)
+| `ticks` | `object` | Tick configuration. [more...](#tick-options)
 
 ## Tick Options
 The following options are provided by the linear scale. They are all located in the `ticks` sub options. The [common tick configuration](../styling.md#tick-configuration) options are supported by this axis.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
+| ---- | ---- | ------- | -----------
 | `backdropColor` | `Color` | `'rgba(255, 255, 255, 0.75)'` | Color of label backdrops.
-| `backdropPaddingX` | `Number` | `2` | Horizontal padding of label backdrop.
-| `backdropPaddingY` | `Number` | `2` | Vertical padding of label backdrop.
-| `beginAtZero` | `Boolean` | `false` | if true, scale will include 0 if it is not already included.
-| `min` | `Number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
-| `max` | `Number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
-| `maxTicksLimit` | `Number` | `11` | Maximum number of ticks and gridlines to show.
-| `precision` | `Number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
-| `stepSize` | `Number` | | User defined fixed step size for the scale. [more...](#step-size)
-| `suggestedMax` | `Number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
-| `suggestedMin` | `Number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
-| `showLabelBackdrop` | `Boolean` | `true` | If true, draw a background behind the tick labels.
+| `backdropPaddingX` | `number` | `2` | Horizontal padding of label backdrop.
+| `backdropPaddingY` | `number` | `2` | Vertical padding of label backdrop.
+| `beginAtZero` | `boolean` | `false` | if true, scale will include 0 if it is not already included.
+| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
+| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
+| `maxTicksLimit` | `number` | `11` | Maximum number of ticks and gridlines to show.
+| `precision` | `number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
+| `stepSize` | `number` | | User defined fixed step size for the scale. [more...](#step-size)
+| `suggestedMax` | `number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
+| `suggestedMin` | `number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
+| `showLabelBackdrop` | `boolean` | `true` | If true, draw a background behind the tick labels.
 
 ## Axis Range Settings
 
@@ -70,7 +70,7 @@ let chart = new Chart(ctx, {
 In contrast to the `suggested*` settings, the `min` and `max` settings set explicit ends to the axes. When these are set, some data points may not be visible.
 
 ## Step Size
- If set, the scale ticks will be enumerated by multiple of stepSize, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
+If set, the scale ticks will be enumerated by multiple of `stepSize`, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
 
 This example sets up a chart with a y axis that creates ticks at `0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5`.
 
@@ -91,22 +91,22 @@ let options = {
 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.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `display` | `Boolean` | `true` | if true, angle lines are shown.
-| `color` | `Color` | `rgba(0, 0, 0, 0.1)` | Color of angled lines.
-| `lineWidth` | `Number` | `1` | Width of angled lines.
-| `borderDash` | `Number[]` | `[]` | Length and spacing of dashes on angled lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
-| `borderDashOffset` | `Number` | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
+| ---- | ---- | ------- | -----------
+| `display` | `boolean` | `true` | if true, angle lines are shown.
+| `color` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Color of angled lines.
+| `lineWidth` | `number` | `1` | Width of angled lines.
+| `borderDash` | `number[]` | `[]` | Length and spacing of dashes on angled lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
+| `borderDashOffset` | `number` | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
 
 ## Point Label Options
 
 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.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `callback` | `Function` | | Callback function to transform data labels to point labels. The default implementation simply returns the current string.
-| `fontColor` | `Color/Color[]` | `'#666'` | Font color for point labels.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family to use when rendering labels.
-| `fontSize` | `Number` | 10 | font size in pixels.
-| `fontStyle` | `String` | `'normal'` | Font style to use when rendering point labels.
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
+| ---- | ---- | ------- | -----------
+| `callback` | `function` | | Callback function to transform data labels to point labels. The default implementation simply returns the current string.
+| `fontColor` | <code>Color&#124;Color[]</code> | `'#666'` | Font color for point labels.
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family to use when rendering labels.
+| `fontSize` | `number` | `10` | font size in pixels.
+| `fontStyle` | `string` | `'normal'` | Font style to use when rendering point labels.
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
index 1f06ca7af4aecd459e403ad05a71a2dc36dd534b..e0089cb37255b89057b2b5c6d05620fc7e26fbb9 100644 (file)
@@ -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
-| -----| ---- | --------| -----------
-| `display` | `Boolean` | `true` | If false, do not display grid lines for this axis.
-| `circular` | `Boolean` | `false` | If true, gridlines are circular (on radar chart only).
-| `color` | `Color/Color[]` | `'rgba(0, 0, 0, 0.1)'` | The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on.
-| `borderDash` | `Number[]` | `[]` | Length and spacing of dashes on grid lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
-| `borderDashOffset` | `Number` | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
-| `lineWidth` | `Number/Number[]` | `1` | Stroke width of grid lines.
-| `drawBorder` | `Boolean` | `true` | If true, draw border at the edge between the axis and the chart area.
-| `drawOnChartArea` | `Boolean` | `true` | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn.
-| `drawTicks` | `Boolean` | `true` | If true, draw lines beside the ticks in the axis area beside the chart.
-| `tickMarkLength` | `Number` | `10` | Length in pixels that the grid lines will draw into the axis area.
-| `zeroLineWidth` | `Number` | `1` | Stroke width of the grid line for the first index (index 0).
-| `zeroLineColor` | Color | `'rgba(0, 0, 0, 0.25)'` | Stroke color of the grid line for the first index (index 0).
-| `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).
-| `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).
-| `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.
+| ---- | ---- | ------- | -----------
+| `display` | `boolean` | `true` | If false, do not display grid lines for this axis.
+| `circular` | `boolean` | `false` | If true, gridlines are circular (on radar chart only).
+| `color` | <code>Color&#124;Color[]</code> | `'rgba(0, 0, 0, 0.1)'` | The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on.
+| `borderDash` | `number[]` | `[]` | Length and spacing of dashes on grid lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
+| `borderDashOffset` | `number` | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
+| `lineWidth` | <code>number&#124;number[]</code> | `1` | Stroke width of grid lines.
+| `drawBorder` | `boolean` | `true` | If true, draw border at the edge between the axis and the chart area.
+| `drawOnChartArea` | `boolean` | `true` | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn.
+| `drawTicks` | `boolean` | `true` | If true, draw lines beside the ticks in the axis area beside the chart.
+| `tickMarkLength` | `number` | `10` | Length in pixels that the grid lines will draw into the axis area.
+| `zeroLineWidth` | `number` | `1` | Stroke width of the grid line for the first index (index 0).
+| `zeroLineColor` | `Color` | `'rgba(0, 0, 0, 0.25)'` | Stroke color of the grid line for the first index (index 0).
+| `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).
+| `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).
+| `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.
 
 ## Tick Configuration
 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.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `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).
-| `display` | `Boolean` | `true` | If true, show tick marks.
+| ---- | ---- | ------- | -----------
+| `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).
+| `display` | `boolean` | `true` | If true, show tick marks.
 | `fontColor` | `Color` | `'#666'` | Font color for tick labels.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
-| `fontSize` | `Number` | `12` | Font size for the tick labels.
-| `fontStyle` | `String` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
-| `reverse` | `Boolean` | `false` | Reverses order of tick labels.
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
+| `fontSize` | `number` | `12` | Font size for the tick labels.
+| `fontStyle` | `string` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
+| `reverse` | `boolean` | `false` | Reverses order of tick labels.
 | `minor` | `object` | `{}` | Minor ticks configuration. Omitted options are inherited from options above.
 | `major` | `object` | `{}` | Major ticks configuration. Omitted options are inherited from options above.
-| `padding` | `Number` | `0` | Sets the offset of the tick labels from the axis
+| `padding` | `number` | `0` | Sets the offset of the tick labels from the axis
 
 ## Minor Tick Configuration
 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.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `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).
+| ---- | ---- | ------- | -----------
+| `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).
 | `fontColor` | `Color` | `'#666'` | Font color for tick labels.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
-| `fontSize` | `Number` | `12` | Font size for the tick labels.
-| `fontStyle` | `String` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
+| `fontSize` | `number` | `12` | Font size for the tick labels.
+| `fontStyle` | `string` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
 
 ## Major Tick Configuration
 The majorTick configuration is nested under the ticks configuration in the `major` key. It defines options for the major tick marks that are generated by the axis. Omitted options are inherited from `ticks` configuration.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `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).
+| ---- | ---- | ------- | -----------
+| `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).
 | `fontColor` | `Color` | `'#666'` | Font color for tick labels.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
-| `fontSize` | `Number` | `12` | Font size for the tick labels.
-| `fontStyle` | `String` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the tick labels, follows CSS font-family options.
+| `fontSize` | `number` | `12` | Font size for the tick labels.
+| `fontStyle` | `string` | `'normal'` | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
index 0af96898a956def5cc8de98209673f966a3d0b79..824a469e87238deabf55e115065230fca695367e 100644 (file)
@@ -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 <sup>2</sup> | `String` | `'start'`, `'end'`, `'origin'` |
-| Disabled <sup>3</sup> | `Boolean` | `false` |
+| Absolute dataset index <sup>1</sup> | `number` | `1`, `2`, `3`, ... |
+| Relative dataset index <sup>1</sup> | `string` | `'-1'`, `'-2'`, `'+1'`, ... |
+| Boundary <sup>2</sup> | `string` | `'start'`, `'end'`, `'origin'` |
+| Disabled <sup>3</sup> | `boolean` | `false` |
 
 > <sup>1</sup> dataset filling modes have been introduced in version 2.6.0<br>
 > <sup>2</sup> prior version 2.6.0, boundary values was `'zero'`, `'top'`, `'bottom'` (deprecated)<br>
@@ -29,16 +29,16 @@ new Chart(ctx, {
             {fill: '-2'}           // 4: fill to dataset 2
         ]
     }
-})
+});
 ```
 
 ## Configuration
 | Option | Type | Default | Description |
 | :--- | :--- | :--- | :--- |
-| [`plugins.filler.propagate`](#propagate) | `Boolean` | `true` | Fill propagation when target is hidden.
+| [`plugins.filler.propagate`](#propagate) | `boolean` | `true` | Fill propagation when target is hidden.
 
 ### propagate
-Boolean (default: `true`)
+`propagate` takes a `boolean` value (default: `true`).
 
 If `true`, the fill area will be recursively extended to the visible target defined by the `fill` value of hidden dataset targets:
 
@@ -61,7 +61,7 @@ new Chart(ctx, {
             }
         }
     }
-})
+});
 ```
 
 `propagate: true`:
index d1048a8c6e8fc0e2dbede8823e28fe20e000c1ee..88e2744c7138a2884f2c0e92b6158f763ebe6aa1 100644 (file)
@@ -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](../general/options.md#indexable-options) |  Default
+| Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderSkipped`](#borderskipped) | `String` | Yes | Yes | `'bottom'`
-| [`borderWidth`](#styling) | `Number` | Yes | Yes | `0`
-| [`data`](#data-structure) | `Object[]` | - | - | **required**
+| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderSkipped`](#borderskipped) | `string` | Yes | Yes | `'bottom'`
+| [`borderWidth`](#styling) | `number` | Yes | Yes | `0`
+| [`data`](#data-structure) | `object[]` | - | - | **required**
 | [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | - | Yes | `undefined`
 | [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | - | Yes | `undefined`
-| [`hoverBorderWidth`](#interactions) | `Number` | - | Yes | `1`
-| [`label`](#general) | `String` | - | - | `''`
-| [`xAxisID`](#general) | `String` | - | - | first x axis
-| [`yAxisID`](#general) | `String` | - | - | first y axis
+| [`hoverBorderWidth`](#interactions) | `number` | - | Yes | `1`
+| [`label`](#general) | `string` | - | - | `''`
+| [`xAxisID`](#general) | `string` | - | - | first x axis
+| [`yAxisID`](#general) | `string` | - | - | first y axis
 
 ### General
 
@@ -130,12 +130,12 @@ The bar chart accepts the following configuration from the associated `scale` op
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `barPercentage` | `Number` | `0.9` | Percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other. [more...](#barpercentage-vs-categorypercentage)
-| `categoryPercentage` | `Number` | `0.8` | Percent (0-1) of the available width each category should be within the sample width. [more...](#barpercentage-vs-categorypercentage)
-| `barThickness` | `Number/String` | | Manually set width of each bar in pixels. If set to `'flex'`, it computes "optimal" sample widths that globally arrange bars side by side. If not set (default), bars are equally sized based on the smallest interval. [more...](#barthickness)
-| `maxBarThickness` | `Number` | | Set this to ensure that bars are not sized thicker than this.
-| `minBarLength` | `Number` | | Set this to ensure that bars have a minimum length in pixels.
-| `gridLines.offsetGridLines` | `Boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines)
+| `barPercentage` | `number` | `0.9` | Percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other. [more...](#barpercentage-vs-categorypercentage)
+| `categoryPercentage` | `number` | `0.8` | Percent (0-1) of the available width each category should be within the sample width. [more...](#barpercentage-vs-categorypercentage)
+| `barThickness` | <code>number&#124;string</code> | | Manually set width of each bar in pixels. If set to `'flex'`, it computes "optimal" sample widths that globally arrange bars side by side. If not set (default), bars are equally sized based on the smallest interval. [more...](#barthickness)
+| `maxBarThickness` | `number` | | Set this to ensure that bars are not sized thicker than this.
+| `minBarLength` | `number` | | Set this to ensure that bars have a minimum length in pixels.
+| `gridLines.offsetGridLines` | `boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines)
 
 ### Example Usage
 
@@ -152,7 +152,7 @@ options = {
             }
         }]
     }
-}
+};
 ```
 ### barThickness
 If this value is a number, it is applied to the width of each bar, in pixels. When this is enforced, `barPercentage` and `categoryPercentage` are ignored.
@@ -194,7 +194,7 @@ Sample:     |==============|
 
 ## Data Structure
 
-The `data` property of a dataset for a bar chart is specified as a an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis.
+The `data` property of a dataset for a bar chart is specified as an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis.
 
 ```javascript
 data: [20, 10]
@@ -233,7 +233,7 @@ The following dataset properties are specific to stacked bar charts.
 
 | Name | Type | Description
 | ---- | ---- | -----------
-| `stack` | `String` | The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack).
+| `stack` | `string` | The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack).
 
 # Horizontal Bar Chart
 A horizontal bar chart is a variation on a vertical bar chart. It is sometimes used to show trend data, and the comparison of multiple data sets side by side.
index 72ee960f039ccd510b1f83cccc3cbffd432c351f..b94c98c17d5c549b75e2098187d494ff1b96c7df 100644 (file)
@@ -19,7 +19,7 @@ A bubble chart is used to display three dimensions of data at the same time. The
             }],
             "backgroundColor": "rgb(255, 99, 132)"
         }]
-    },
+    }
 }
 {% endchartjs %}
 
@@ -27,7 +27,7 @@ A bubble chart is used to display three dimensions of data at the same time. The
 
 ```javascript
 // For a bubble chart
-var myBubbleChart = new Chart(ctx,{
+var myBubbleChart = new Chart(ctx, {
     type: 'bubble',
     data: data,
     options: options
@@ -38,21 +38,21 @@ var myBubbleChart = new Chart(ctx,{
 
 The bubble 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 the bubbles is generally set this way.
 
-| Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) |  Default
+| Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderWidth`](#styling) | `Number` | Yes | Yes | `3`
-| [`data`](#data-structure) | `Object[]` | - | - | **required**
+| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderWidth`](#styling) | `number` | Yes | Yes | `3`
+| [`data`](#data-structure) | `object[]` | - | - | **required**
 | [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
 | [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
-| [`hoverBorderWidth`](#interactions) | `Number` | Yes | Yes | `1`
-| [`hoverRadius`](#interactions) | `Number` | Yes | Yes | `4`
-| [`hitRadius`](#interactions) | `Number` | Yes | Yes | `1`
-| [`label`](#labeling) | `String` | - | - | `undefined`
-| [`pointStyle`](#styling) | `String` | Yes | Yes | `circle`
-| [`rotation`](#styling) | `Number` | Yes | Yes | `0`
-| [`radius`](#styling) | `Number` | Yes | Yes | `3`
+| [`hoverBorderWidth`](#interactions) | `number` | Yes | Yes | `1`
+| [`hoverRadius`](#interactions) | `number` | Yes | Yes | `4`
+| [`hitRadius`](#interactions) | `number` | Yes | Yes | `1`
+| [`label`](#labeling) | `string` | - | - | `undefined`
+| [`pointStyle`](#styling) | `string` | Yes | Yes | `'circle'`
+| [`rotation`](#styling) | `number` | Yes | Yes | `0`
+| [`radius`](#styling) | `number` | Yes | Yes | `3`
 
 ### Labeling
 
@@ -98,13 +98,13 @@ Bubble chart datasets need to contain a `data` array of points, each points repr
 ```javascript
 {
     // X Value
-    x: <Number>,
+    x: number,
 
     // Y Value
-    y: <Number>,
+    y: number,
 
     // Bubble radius in pixels (not scaled).
-    r: <Number>
+    r: number
 }
 ```
 
index 9d3e8c5808ea421378ef5c31032fb9086be460ce..ad1af3106ef2a96eb325db585178f83a810e8e8d 100644 (file)
@@ -14,7 +14,7 @@ They are also registered under two aliases in the `Chart` core. Other than their
         "labels": [
             "Red",
             "Blue",
-            "Yellow",
+            "Yellow"
         ],
         "datasets": [{
             "label": "My First Dataset",
@@ -22,10 +22,10 @@ They are also registered under two aliases in the `Chart` core. Other than their
             "backgroundColor": [
                 "rgb(255, 99, 132)",
                 "rgb(54, 162, 235)",
-                "rgb(255, 205, 86)",
+                "rgb(255, 205, 86)"
             ]
         }]
-    },
+    }
 }
 {% endchartjs %}
 
@@ -33,7 +33,7 @@ They are also registered under two aliases in the `Chart` core. Other than their
 
 ```javascript
 // For a pie chart
-var myPieChart = new Chart(ctx,{
+var myPieChart = new Chart(ctx, {
     type: 'pie',
     data: data,
     options: options
@@ -55,14 +55,14 @@ The doughnut/pie chart allows a number of properties to be specified for each da
 
 | Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderAlign`](#border-alignment) | `String` | Yes | Yes | `'center'`
+| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderAlign`](#border-alignment) | `string` | Yes | Yes | `'center'`
 | [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'#fff'`
-| [`borderWidth`](#styling) | `Number` | Yes | Yes | `2`
-| [`data`](#data-structure) | `Number[]` | - | - | **required**
+| [`borderWidth`](#styling) | `number` | Yes | Yes | `2`
+| [`data`](#data-structure) | `number[]` | - | - | **required**
 | [`hoverBackgroundColor`](#interations) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
 | [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
-| [`hoverBorderWidth`](#interactions) | `Number` | Yes | Yes | `undefined`
+| [`hoverBorderWidth`](#interactions) | `number` | Yes | Yes | `undefined`
 
 ### Styling
 
@@ -102,11 +102,11 @@ These are the customisation options specific to Pie & Doughnut charts. These opt
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `cutoutPercentage` | `Number` | `50` - for doughnut, `0` - for pie | The percentage of the chart that is cut out of the middle.
-| `rotation` | `Number` | `-0.5 * Math.PI` | Starting angle to draw arcs from.
-| `circumference` | `Number` | `2 * Math.PI` | Sweep to allow arcs to cover.
-| `animation.animateRotate` | `Boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object.
-| `animation.animateScale` | `Boolean` | `false` | If true, will animate scaling the chart from the center outwards.
+| `cutoutPercentage` | `number` | `50` - for doughnut, `0` - for pie | The percentage of the chart that is cut out of the middle.
+| `rotation` | `number` | `-0.5 * Math.PI` | Starting angle to draw arcs from.
+| `circumference` | `number` | `2 * Math.PI` | Sweep to allow arcs to cover.
+| `animation.animateRotate` | `boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object.
+| `animation.animateScale` | `boolean` | `false` | If true, will animate scaling the chart from the center outwards.
 
 ## Default Options
 
@@ -131,4 +131,4 @@ data = {
         'Blue'
     ]
 };
-```
\ No newline at end of file
+```
index 4783c551470b65d959f6c7b39abcc38e56deefa6..f7744eedbb67987144ce3380790d009a30021460 100644 (file)
@@ -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#scriptable-options) | [Indexable](../general/options.md#indexable-options) |  Default
+| Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0,0,0,0.1)'`
-| [`borderCapStyle`](#line-styling) | `String` | - | - | `'butt'`
-| [`borderColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0,0,0,0.1)'`
-| [`borderDash`](#line-styling) | `Number[]` | - | - | `[]`
-| [`borderDashOffset`](#line-styling) | `Number` | - | - | `0`
-| [`borderJoinStyle`](#line-styling) | `String` | - | - | `'miter'`
-| [`borderWidth`](#line-styling) | `Number` | - | - | `0`
-| [`cubicInterpolationMode`](#cubicInterpolationMode) | `String` | - | - | `''`
-| [`fill`](#line-styling) | `Boolean/String` | - | - | `true`
-| [`label`](#general) | `String` | - | - | `''`
-| [`lineTension`](#line-styling) | `Number` | - | - | `0.4`
-| [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`pointBorderColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`pointBorderWidth`](#point-styling) | `Number` | Yes | Yes | `1`
-| [`pointHitRadius`](#point-styling) | `Number` | Yes | Yes | `1`
+| [`backgroundColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0, 0, 0, 0.1)'`
+| [`borderCapStyle`](#line-styling) | `string` | - | - | `'butt'`
+| [`borderColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0, 0, 0, 0.1)'`
+| [`borderDash`](#line-styling) | `number[]` | - | - | `[]`
+| [`borderDashOffset`](#line-styling) | `number` | - | - | `0.0`
+| [`borderJoinStyle`](#line-styling) | `string` | - | - | `'miter'`
+| [`borderWidth`](#line-styling) | `number` | - | - | `3`
+| [`cubicInterpolationMode`](#cubicinterpolationmode) | `string` | - | - | `''`
+| [`fill`](#line-styling) | <code>boolean&#124;string</code> | - | - | `true`
+| [`label`](#general) | `string` | - | - | `''`
+| [`lineTension`](#line-styling) | `number` | - | - | `0.4`
+| [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`pointBorderColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`pointBorderWidth`](#point-styling) | `number` | Yes | Yes | `1`
+| [`pointHitRadius`](#point-styling) | `number` | Yes | Yes | `1`
 | [`pointHoverBackgroundColor`](#interactions) | `Color` | Yes | Yes | `undefined`
 | [`pointHoverBorderColor`](#interactions) | `Color` | Yes | Yes | `undefined`
-| [`pointHoverBorderWidth`](#interactions) | `Number` | Yes | Yes | `undefined`
-| [`pointHoverRadius`](#interactions) | `Number` | Yes | Yes | `undefined`
-| [`pointRadius`](#point-styling) | `Number` | Yes | Yes | `3`
-| [`pointRotation`](#point-styling) | `Number` | Yes | Yes | `1`
-| [`pointStyle`](#point-styling) | `String/Image` | Yes | Yes | `'circle'`
-| [`showLine`](#general) | `Boolean` | - | - | `undefined`
-| [`spanGaps`](#general) | `Boolean` | - | - | `false`
-| [`steppedLine`](#stepped-line) | `Boolean/String` | - | - | `false`
-| [`xAxisID`](#general) | `String` | - | - | first x axis
-| [`yAxisID`](#general) | `String` | - | - | first y axis
+| [`pointHoverBorderWidth`](#interactions) | `number` | Yes | Yes | `1`
+| [`pointHoverRadius`](#interactions) | `number` | Yes | Yes | `4`
+| [`pointRadius`](#point-styling) | `number` | Yes | Yes | `3`
+| [`pointRotation`](#point-styling) | `number` | Yes | Yes | `0`
+| [`pointStyle`](#point-styling) | <code>string&#124;Image</code> | Yes | Yes | `'circle'`
+| [`showLine`](#line-styling) | `boolean` | - | - | `undefined`
+| [`spanGaps`](#line-styling) | `boolean` | - | - | `undefined`
+| [`steppedLine`](#stepped-line) | <code>boolean&#124;string</code> | - | - | `false`
+| [`xAxisID`](#general) | `string` | - | - | first x axis
+| [`yAxisID`](#general) | `string` | - | - | first y axis
 
 ### General
 
@@ -93,7 +93,7 @@ The style of each point can be controlled with the following properties:
 | `pointRotation` | The rotation of the point in degrees.
 | `pointStyle` | Style of the point. [more...](../configuration/elements#point-styles)
 
-All these values, if `undefined`, fallback first to the dataset options then to the associated [`elements.point.*`](../configuration/elements.md#point-configuration) options. 
+All these values, if `undefined`, fallback first to the dataset options then to the associated [`elements.point.*`](../configuration/elements.md#point-configuration) options.
 
 ### Line Styling
 
@@ -113,7 +113,7 @@ The style of the line can be controlled with the following properties:
 | `showLine` | If false, the line is not drawn for this dataset.
 | `spanGaps` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line.
 
-All these values, if `undefined`, fallback to the associated [`elements.line.*`](../configuration/elements.md#line-configuration) options.
+If the value is `undefined`, `showLine` and `spanGaps` fallback to the associated [chart configuration options](#configuration-options). The rest of the values fallback to the associated [`elements.line.*`](../configuration/elements.md#line-configuration) options.
 
 ### Interactions
 
@@ -128,19 +128,19 @@ The interaction with each point can be controlled with the following properties:
 
 ### cubicInterpolationMode
 The following interpolation modes are supported.
-* 'default'
-* 'monotone'
+* `'default'`
+* `'monotone'`
 
-The 'default' algorithm uses a custom weighted cubic interpolation, which produces pleasant curves for all types of datasets.
+The `'default'` algorithm uses a custom weighted cubic interpolation, which produces pleasant curves for all types of datasets.
 
-The 'monotone' algorithm is more suited to `y = f(x)` datasets : it preserves monotonicity (or piecewise monotonicity) of the dataset being interpolated, and ensures local extremums (if any) stay at input data points.
+The `'monotone'` algorithm is more suited to `y = f(x)` datasets : it preserves monotonicity (or piecewise monotonicity) of the dataset being interpolated, and ensures local extremums (if any) stay at input data points.
 
 If left untouched (`undefined`), the global `options.elements.line.cubicInterpolationMode` property is used.
 
 ### Stepped Line
 The following values are supported for `steppedLine`.
-* `false`:  No Step Interpolation (default)
-* `true`: Step-before Interpolation (eq. 'before')
+* `false`: No Step Interpolation (default)
+* `true`: Step-before Interpolation (eq. `'before'`)
 * `'before'`: Step-before Interpolation
 * `'after'`: Step-after Interpolation
 * `'middle'`: Step-middle Interpolation
@@ -153,8 +153,8 @@ The line chart defines the following configuration options. These options are me
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `showLines` | `Boolean` | `true` | If false, the lines between points are not drawn.
-| `spanGaps` | `Boolean` | `false` | If false, NaN data causes a break in the line.
+| `showLines` | `boolean` | `true` | If false, the lines between points are not drawn.
+| `spanGaps` | `boolean` | `false` | If false, NaN data causes a break in the line.
 
 ## Default Options
 
@@ -169,7 +169,7 @@ Chart.defaults.line.spanGaps = true;
 
 The `data` property of a dataset for a line chart can be passed in two formats.
 
-### Number[]
+### number[]
 ```javascript
 data: [20, 10]
 ```
@@ -180,12 +180,12 @@ When the `data` array is an array of numbers, the x axis is generally a [categor
 
 ```javascript
 data: [{
-        x: 10,
-        y: 20
-    }, {
-        x: 15,
-        y: 10
-    }]
+    x: 10,
+    y: 20
+}, {
+    x: 15,
+    y: 10
+}]
 ```
 
 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.
@@ -231,7 +231,7 @@ new Chart(ctx, {
     options: {
         elements: {
             line: {
-                tension: 0, // disables bezier curves
+                tension: 0 // disables bezier curves
             }
         }
     }
@@ -249,11 +249,11 @@ new Chart(ctx, {
     type: 'line',
     data: {
         datasets: [{
-            showLine: false, // disable for a single dataset
+            showLine: false // disable for a single dataset
         }]
     },
     options: {
-        showLines: false, // disable for all datasets
+        showLines: false // disable for all datasets
     }
 });
 ```
@@ -270,12 +270,12 @@ new Chart(ctx, {
     data: data,
     options: {
         animation: {
-            duration: 0, // general animation time
+            duration: 0 // general animation time
         },
         hover: {
-            animationDuration: 0, // duration of animations when hovering an item
+            animationDuration: 0 // duration of animations when hovering an item
         },
-        responsiveAnimationDuration: 0, // animation duration after a resize
+        responsiveAnimationDuration: 0 // animation duration after a resize
     }
 });
 ```
index 9a51eae860f0b250c07237bbbc411dc596d49de3..9f83f2ea6d8c37bff5bc8b534d8ba1231ae70759 100644 (file)
@@ -6,9 +6,9 @@ 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
 });
 ```
 
@@ -16,21 +16,21 @@ At this point we have a standard bar chart. Now we need to convert one of the da
 
 ```javascript
 var mixedChart = new Chart(ctx, {
-  type: 'bar',
-  data: {
-    datasets: [{
-          label: 'Bar Dataset',
-          data: [10, 20, 30, 40]
+    type: 'bar',
+    data: {
+        datasets: [{
+            label: 'Bar Dataset',
+            data: [10, 20, 30, 40]
         }, {
-          label: 'Line Dataset',
-          data: [50, 50, 50, 50],
+            label: 'Line Dataset',
+            data: [50, 50, 50, 50],
 
-          // Changes this dataset to become a line
-          type: 'line'
+            // Changes this dataset to become a line
+            type: 'line'
         }],
-    labels: ['January', 'February', 'March', 'April']
-  },
-  options: options
+        labels: ['January', 'February', 'March', 'April']
+    },
+    options: options
 });
 ```
 
@@ -38,35 +38,35 @@ At this point we have a chart rendering how we'd like. It's important to note th
 
 {% chartjs %}
 {
-  "type": "bar",
-  "data": {
-    "labels": [
-      "January",
-      "February",
-      "March",
-      "April"
-    ],
-    "datasets": [{
-      "label": "Bar Dataset",
-      "data": [10, 20, 30, 40],
-      "borderColor": "rgb(255, 99, 132)",
-      "backgroundColor": "rgba(255, 99, 132, 0.2)"
-    }, {
-      "label": "Line Dataset",
-      "data": [50, 50, 50, 50],
-      "type": "line",
-      "fill": false,
-      "borderColor": "rgb(54, 162, 235)"
-    }]
-  },
-  "options": {
-    "scales": {
-      "yAxes": [{
-        "ticks": {
-          "beginAtZero": true
+    "type": "bar",
+    "data": {
+        "labels": [
+            "January",
+            "February",
+            "March",
+            "April"
+        ],
+        "datasets": [{
+            "label": "Bar Dataset",
+            "data": [10, 20, 30, 40],
+            "borderColor": "rgb(255, 99, 132)",
+            "backgroundColor": "rgba(255, 99, 132, 0.2)"
+        }, {
+            "label": "Line Dataset",
+            "data": [50, 50, 50, 50],
+            "type": "line",
+            "fill": false,
+            "borderColor": "rgb(54, 162, 235)"
+        }]
+    },
+    "options": {
+        "scales": {
+            "yAxes": [{
+                "ticks": {
+                    "beginAtZero": true
+                }
+            }]
         }
-      }]
     }
-  }
 }
 {% endchartjs %}
index 1d73cd350e3da3e25887da8c93dff72144fc0159..8403a387230331f17067920ba39b9018a8265b61 100644 (file)
@@ -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 | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0,0,0,0.1)'`
-| [`borderAlign`](#border-alignment) | `String` | Yes | Yes | `'center'`
+| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
+| [`borderAlign`](#border-alignment) | `string` | Yes | Yes | `'center'`
 | [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'#fff'`
-| [`borderWidth`](#styling) | `Number` | Yes | Yes | `2`
-| [`data`](#data-structure) | `Number[]` | - | - | **required**
+| [`borderWidth`](#styling) | `number` | Yes | Yes | `2`
+| [`data`](#data-structure) | `number[]` | - | - | **required**
 | [`hoverBackgroundColor`](#interations) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
 | [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
-| [`hoverBorderWidth`](#interactions) | `Number` | Yes | Yes | `undefined`
+| [`hoverBorderWidth`](#interactions) | `number` | Yes | Yes | `undefined`
 
 ### Styling
 
@@ -93,9 +93,9 @@ These are the customisation options specific to Polar Area charts. These options
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `startAngle` | `Number` | `-0.5 * Math.PI` | Starting angle to draw arcs for the first item in a dataset.
-| `animation.animateRotate` | `Boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object.
-| `animation.animateScale` | `Boolean` | `true` | If true, will animate scaling the chart from the center outwards.
+| `startAngle` | `number` | `-0.5 * Math.PI` | Starting angle to draw arcs for the first item in a dataset.
+| `animation.animateRotate` | `boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object.
+| `animation.animateScale` | `boolean` | `true` | If true, will animate scaling the chart from the center outwards.
 
 ## Default Options
 
index 53870c118c4c90c5ece3091e79c4929cde68af58..b1e31d78b07a229f55910954eca1e85d6bc0c3f6 100644 (file)
@@ -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. If these are set to an array value, the first value applies to the first point, the second value to the second point, and so on.
+All `point*` properties can be specified as an array. If these are set to an array value, the first value applies to the first point, the second value to the second point, and so on.
 
 | Name | Type | Description
 | ---- | ---- | -----------
-| `label` | `String` | The label for the dataset which appears in the legend and tooltips.
+| `label` | `string` | The label for the dataset which appears in the legend and tooltips.
 | `backgroundColor` | `Color` | The fill color under the line. See [Colors](../general/colors.md#colors).
 | `borderColor` | `Color` | The color of the line. See [Colors](../general/colors.md#colors).
-| `borderWidth` | `Number` | The width of the line in pixels.
-| `borderDash` | `Number[]` | Length and spacing of dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
-| `borderDashOffset` | `Number` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
-| `borderCapStyle` | `String` | Cap style of the line. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap).
-| `borderJoinStyle` | `String` | Line joint style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
-| `fill` | `Boolean/String` | How to fill the area under the line. See [area charts](area.md).
-| `lineTension` | `Number` | Bezier curve tension of the line. Set to 0 to draw straightlines.
-| `pointBackgroundColor` | `Color/Color[]` | The fill color for points.
-| `pointBorderColor` | `Color/Color[]` | The border color for points.
-| `pointBorderWidth` | `Number/Number[]` | The width of the point border in pixels.
-| `pointRadius` | `Number/Number[]` | The radius of the point shape. If set to 0, the point is not rendered.
-| `pointRotation` | `Number/Number[]` | The rotation of the point in degrees.
-| `pointStyle` | `String/String[]/Image/Image[]` | Style of the point. [more...](#pointstyle)
-| `pointHitRadius` | `Number/Number[]` | The pixel size of the non-displayed point that reacts to mouse events.
-| `pointHoverBackgroundColor` | `Color/Color[]` | Point background color when hovered.
-| `pointHoverBorderColor` | `Color/Color[]` | Point border color when hovered.
-| `pointHoverBorderWidth` | `Number/Number[]` | Border width of point when hovered.
-| `pointHoverRadius` | `Number/Number[]` | The radius of the point when hovered.
+| `borderWidth` | `number` | The width of the line in pixels.
+| `borderDash` | `number[]` | Length and spacing of dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
+| `borderDashOffset` | `number` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
+| `borderCapStyle` | `string` | Cap style of the line. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap).
+| `borderJoinStyle` | `string` | Line joint style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
+| `fill` | <code>boolean&#124;string</code> | How to fill the area under the line. See [area charts](area.md).
+| `lineTension` | `number` | Bezier curve tension of the line. Set to 0 to draw straightlines.
+| `pointBackgroundColor` | <code>Color&#124;Color[]</code> | The fill color for points.
+| `pointBorderColor` | <code>Color&#124;Color[]</code> | The border color for points.
+| `pointBorderWidth` | <code>number&#124;number[]</code> | The width of the point border in pixels.
+| `pointRadius` | <code>number&#124;number[]</code> | The radius of the point shape. If set to 0, the point is not rendered.
+| `pointRotation` | <code>number&#124;number[]</code> | The rotation of the point in degrees.
+| `pointStyle` | <code>string&#124;string[]&#124;Image&#124;Image[]</code> | Style of the point. [more...](#pointstyle)
+| `pointHitRadius` | <code>number&#124;number[]</code> | The pixel size of the non-displayed point that reacts to mouse events.
+| `pointHoverBackgroundColor` | <code>Color&#124;Color[]</code> | Point background color when hovered.
+| `pointHoverBorderColor` | <code>Color&#124;Color[]</code> | Point border color when hovered.
+| `pointHoverBorderWidth` | <code>number&#124;number[]</code> | Border width of point when hovered.
+| `pointHoverRadius` | <code>number&#124;number[]</code> | The radius of the point when hovered.
 
 ### pointStyle
 The style of point. Options are:
-* 'circle'
-* 'cross'
-* 'crossRot'
-* 'dash'.
-* 'line'
-* 'rect'
-* 'rectRounded'
-* 'rectRot'
-* 'star'
-* 'triangle'
+* `'circle'`
+* `'cross'`
+* `'crossRot'`
+* `'dash'.`
+* `'line'`
+* `'rect'`
+* `'rectRounded'`
+* `'rectRot'`
+* `'star'`
+* `'triangle'`
 
 If the option is an image, that image is drawn on the canvas using [drawImage](https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/drawImage).
 
@@ -128,7 +128,7 @@ It is common to want to apply a configuration setting to all created radar chart
 
 ## Data Structure
 
-The `data` property of a dataset for a radar chart is specified as a an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis.
+The `data` property of a dataset for a radar chart is specified as an array of numbers. Each point in the data array corresponds to the label at the same index on the x axis.
 
 ```javascript
 data: [20, 10]
index ef4e6f711676f0a27434995154024382e999b631..0107fd4c238768b130f1046d249d1e6d66eafa4c 100644 (file)
@@ -46,4 +46,4 @@ data: [{
         x: 15,
         y: 10
     }]
-```
\ No newline at end of file
+```
index 28ae0fe4edf5194333cacd04a349e784fdfff325..0a4dee450c9edde0974e74b3c85d1e33b8dce974 100644 (file)
@@ -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: 'line',
-    data: data,
+    data: data
 });
 
 // This chart would have the hover mode that was passed in
@@ -29,5 +29,5 @@ var chartDifferentHoverMode = new Chart(ctx, {
             mode: 'index'
         }
     }
-})
+});
 ```
index 66c7b166eb4ceec78b88443c90c12f385e883260..40dd8ec3ff7f20fe2c999b0648a062172f9c1ef6 100644 (file)
@@ -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` | `Number` | `1000` | The number of milliseconds an animation takes.
-| `easing` | `String` | `'easeOutQuart'` | Easing function to use. [more...](#easing)
-| `onProgress` | `Function` | `null` | Callback called on each step of an animation. [more...](#animation-callbacks)
-| `onComplete` | `Function` | `null` | Callback called at the end of an animation. [more...](#animation-callbacks)
+| ---- | ---- | ------- | -----------
+| `duration` | `number` | `1000` | The number of milliseconds an animation takes.
+| `easing` | `string` | `'easeOutQuart'` | Easing function to use. [more...](#easing)
+| `onProgress` | `function` | `null` | Callback called on each step of an animation. [more...](#animation-callbacks)
+| `onComplete` | `function` | `null` | Callback called at the end of an animation. [more...](#animation-callbacks)
 
 ## Easing
- Available options are:
+
+Available options are:
 * `'linear'`
 * `'easeInQuad'`
 * `'easeOutQuad'`
@@ -59,22 +60,22 @@ The `onProgress` and `onComplete` callbacks are useful for synchronizing an exte
     chart: Chart,
 
     // Current Animation frame number
-    currentStep: Number,
+    currentStep: number,
 
     // Number of animation frames
-    numSteps: Number,
+    numSteps: number,
 
     // Animation easing to use
-    easing: String,
+    easing: string,
 
     // Function that renders the chart
-    render: Function,
+    render: function,
 
     // User callback
-    onAnimationProgress: Function,
+    onAnimationProgress: function,
 
     // User callback
-    onAnimationComplete: Function
+    onAnimationComplete: function
 }
 ```
 
index e6a6c07c8f6173e125587b9fd0e01a7919e4744e..a2a794d3de21d27cd3e891de06eedd1079a2e624 100644 (file)
@@ -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.global.elements.point`.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `radius` | `Number` | `3` | Point radius.
-| [`pointStyle`](#point-styles) | `String` | `circle` | Point style.
-| `rotation` | `Number` | `0` | Point rotation (in degrees).
-| `backgroundColor` | `Color` | `'rgba(0,0,0,0.1)'` | Point fill color.
-| `borderWidth` | `Number` | `1` | Point stroke width.
-| `borderColor` | `Color` | `'rgba(0,0,0,0.1)'` | Point stroke color.
-| `hitRadius` | `Number` | `1` | Extra radius added to point radius for hit detection.
-| `hoverRadius` | `Number` | `4` | Point radius when hovered.
-| `hoverBorderWidth` | `Number` | `1` | Stroke width when hovered.
+| ---- | ---- | ------- | -----------
+| `radius` | `number` | `3` | Point radius.
+| [`pointStyle`](#point-styles) | <code>string&#124;Image</code> | `'circle'` | Point style.
+| `rotation` | `number` | `0` | Point rotation (in degrees).
+| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Point fill color.
+| `borderWidth` | `number` | `1` | Point stroke width.
+| `borderColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Point stroke color.
+| `hitRadius` | `number` | `1` | Extra radius added to point radius for hit detection.
+| `hoverRadius` | `number` | `4` | Point radius when hovered.
+| `hoverBorderWidth` | `number` | `1` | Stroke width when hovered.
 
 ### Point Styles
 
@@ -49,18 +49,18 @@ Line elements are used to represent the line in a line chart.
 Global line options: `Chart.defaults.global.elements.line`.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `tension` | `Number` | `0.4` | Bézier curve tension (`0` for no Bézier curves).
-| `backgroundColor` | `Color` | `'rgba(0,0,0,0.1)'` | Line fill color.
-| `borderWidth` | `Number` | `3` | Line stroke width.
-| `borderColor` | `Color` | `'rgba(0,0,0,0.1)'` | Line stroke color.
-| `borderCapStyle` | `String` | `'butt'` | Line cap style. See [MDN](https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap).
-| `borderDash` | `Array` | `[]` | Line dash. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
-| `borderDashOffset` | `Number` | `0` | Line dash offset. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
-| `borderJoinStyle` | `String` | `'miter` | Line join style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
-| `capBezierPoints` | `Boolean` | `true` | `true` to keep Bézier control inside the chart, `false` for no restriction.
-| `fill` | `Boolean/String` | `true` | Fill location: `'zero'`, `'top'`, `'bottom'`, `true` (eq. `'zero'`) or `false` (no fill).
-| `stepped` | `Boolean` | `false` | `true` to show the line as a stepped line (`tension` will be ignored).
+| ---- | ---- | ------- | -----------
+| `tension` | `number` | `0.4` | Bézier curve tension (`0` for no Bézier curves).
+| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Line fill color.
+| `borderWidth` | `number` | `3` | Line stroke width.
+| `borderColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Line stroke color.
+| `borderCapStyle` | `string` | `'butt'` | Line cap style. See [MDN](https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap).
+| `borderDash` | `number[]` | `[]` | Line dash. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
+| `borderDashOffset` | `number` | `0.0` | Line dash offset. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
+| `borderJoinStyle` | `string` | `'miter'` | Line join style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
+| `capBezierPoints` | `boolean` | `true` | `true` to keep Bézier control inside the chart, `false` for no restriction.
+| `fill` | <code>boolean&#124;string</code> | `true` | Fill location: `'zero'`, `'top'`, `'bottom'`, `true` (eq. `'zero'`) or `false` (no fill).
+| `stepped` | `boolean` | `false` | `true` to show the line as a stepped line (`tension` will be ignored).
 
 ## Rectangle Configuration
 Rectangle elements are used to represent the bars in a bar chart.
@@ -68,11 +68,11 @@ Rectangle elements are used to represent the bars in a bar chart.
 Global rectangle options: `Chart.defaults.global.elements.rectangle`.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `backgroundColor` | `Color` | `'rgba(0,0,0,0.1)'` | Bar fill color.
-| `borderWidth` | `Number` | `0` | Bar stroke width.
-| `borderColor` | `Color` | `'rgba(0,0,0,0.1)'` | Bar stroke color.
-| `borderSkipped` | `String` | `'bottom'` | Skipped (excluded) border: `'bottom'`, `'left'`, `'top'` or `'right'`.
+| ---- | ---- | ------- | -----------
+| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Bar fill color.
+| `borderWidth` | `number` | `0` | Bar stroke width.
+| `borderColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Bar stroke color.
+| `borderSkipped` | `string` | `'bottom'` | Skipped (excluded) border: `'bottom'`, `'left'`, `'top'` or `'right'`.
 
 ## Arc Configuration
 Arcs are used in the polar area, doughnut and pie charts.
@@ -80,7 +80,8 @@ Arcs are used in the polar area, doughnut and pie charts.
 Global arc options: `Chart.defaults.global.elements.arc`.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `backgroundColor` | `Color` | `'rgba(0,0,0,0.1)'` | Arc fill color.
+| ---- | ---- | ------- | -----------
+| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Arc fill color.
+| `borderAlign` | `string` | `'center'` | Arc stroke alignment.
 | `borderColor` | `Color` | `'#fff'` | Arc stroke color.
-| `borderWidth`| `Number` | `2` | Arc stroke width.
+| `borderWidth`| `number` | `2` | Arc stroke width.
index fcd42fdd49920aef4b71419b8fa541f70782e77b..375a480702fe8e6b4637c276d1770c211f0c391c 100644 (file)
@@ -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 inside the chart. [more...](#padding)
+| ---- | ---- | ------- | -----------
+| `padding` | <code>number&#124;object</code> | `0` | The padding to add inside the chart. [more...](#padding)
 
 ## Padding
-If this value is a number, it is applied to all sides of the chart (left, top, right, bottom). If this value is an object, the `left` property defines the left padding. Similarly the `right`, `top`, and `bottom` properties can also be specified.
+If this value is a number, it is applied to all sides of the chart (left, top, right, bottom). If this value is an object, the `left` property defines the left padding. Similarly the `right`, `top` and `bottom` properties can also be specified.
 
 Lets say you wanted to add 50px of padding to the left side of the chart canvas, you would do:
 
@@ -26,4 +26,4 @@ let chart = new Chart(ctx, {
         }
     }
 });
-```
\ No newline at end of file
+```
index 5663733916bafd2d7f066dffa19e755cc6e5a1a6..9655a67167a624bfaf7d1382ab193ca5370e0ec4 100644 (file)
@@ -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
-| -----| ---- | --------| -----------
-| `display` | `Boolean` | `true` | Is the legend shown?
-| `position` | `String` | `'top'` | Position of the legend. [more...](#position)
-| `fullWidth` | `Boolean` | `true` | Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely to need to be changed in day-to-day use.
-| `onClick` | `Function` | | A callback that is called when a click event is registered on a label item.
-| `onHover` | `Function` | | A callback that is called when a 'mousemove' event is registered on top of a label item.
-| `reverse` | `Boolean` | `false` | Legend will show datasets in reverse order.
-| `labels` | `Object` | | See the [Legend Label Configuration](#legend-label-configuration) section below.
+| ---- | ---- | ------- | -----------
+| `display` | `boolean` | `true` | Is the legend shown?
+| `position` | `string` | `'top'` | Position of the legend. [more...](#position)
+| `fullWidth` | `boolean` | `true` | Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely to need to be changed in day-to-day use.
+| `onClick` | `function` | | A callback that is called when a click event is registered on a label item.
+| `onHover` | `function` | | A callback that is called when a 'mousemove' event is registered on top of a label item.
+| `reverse` | `boolean` | `false` | Legend will show datasets in reverse order.
+| `labels` | `object` | | See the [Legend Label Configuration](#legend-label-configuration) section below.
 
 ## Position
 Position of the legend. Options are:
@@ -27,16 +27,16 @@ Position of the legend. Options are:
 The legend label configuration is nested below the legend configuration using the `labels` key.
 
 | Name | Type | Default | Description
-| -----| ---- | --------| -----------
-| `boxWidth` | `Number` | `40` | Width of coloured box.
-| `fontSize` | `Number` | `12` | Font size of text.
-| `fontStyle` | `String` | `'normal'` | Font style of text.
+| ---- | ---- | ------- | -----------
+| `boxWidth` | `number` | `40` | Width of coloured box.
+| `fontSize` | `number` | `12` | Font size of text.
+| `fontStyle` | `string` | `'normal'` | Font style of text.
 | `fontColor` | `Color` | `'#666'` | Color of text.
-| `fontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family of legend text.
-| `padding` | `Number` | `10` | Padding between rows of colored boxes.
-| `generateLabels` | `Function` | | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See [Legend Item](#legend-item-interface) for details.
-| `filter` | `Function` | `null` | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#legend-item-interface) and the chart data.
-| `usePointStyle` | `Boolean` | `false` | Label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family of legend text.
+| `padding` | `number` | `10` | Padding between rows of colored boxes.
+| `generateLabels` | `function` | | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See [Legend Item](#legend-item-interface) for details.
+| `filter` | `function` | `null` | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#legend-item-interface) and the chart data.
+| `usePointStyle` | `boolean` | `false` | Label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
 
 ## Legend Item Interface
 
@@ -45,34 +45,34 @@ Items passed to the legend `onClick` function are the ones returned from `labels
 ```javascript
 {
     // Label that will be displayed
-    text: String,
+    text: string,
 
     // Fill style of the legend box
     fillStyle: Color,
 
     // If true, this item represents a hidden dataset. Label will be rendered with a strike-through effect
-    hidden: Boolean,
+    hidden: boolean,
 
     // For box border. See https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap
-    lineCap: String,
+    lineCap: string,
 
     // For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
-    lineDash: Array[Number],
+    lineDash: number[],
 
     // For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
-    lineDashOffset: Number,
+    lineDashOffset: number,
 
     // For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
-    lineJoin: String,
+    lineJoin: string,
 
     // Width of box border
-    lineWidth: Number,
+    lineWidth: number,
 
     // Stroke style of the legend box
-    strokeStyle: Color
+    strokeStyle: Color,
 
     // Point style of the legend box (only used if usePointStyle is true)
-    pointStyle: String
+    pointStyle: string
 }
 ```
 
@@ -91,7 +91,7 @@ var chart = new Chart(ctx, {
                 fontColor: 'rgb(255, 99, 132)'
             }
         }
-}
+    }
 });
 ```
 
@@ -107,7 +107,7 @@ function(e, legendItem) {
     var meta = ci.getDatasetMeta(index);
 
     // See controller.isDatasetVisible comment
-    meta.hidden = meta.hidden === null? !ci.data.datasets[index].hidden : null;
+    meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
 
     // We hid a dataset ... rerender the chart
     ci.update();
@@ -126,9 +126,11 @@ var newLegendClickHandler = function (e, legendItem) {
         defaultLegendClickHandler(e, legendItem);
     } else {
         let ci = this.chart;
-        [ci.getDatasetMeta(0),
-         ci.getDatasetMeta(1)].forEach(function(meta) {
-            meta.hidden = meta.hidden === null? !ci.data.datasets[index].hidden : null;
+        [
+            ci.getDatasetMeta(0),
+            ci.getDatasetMeta(1)
+        ].forEach(function(meta) {
+            meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
         });
         ci.update();
     }
@@ -139,7 +141,7 @@ var chart = new Chart(ctx, {
     data: data,
     options: {
         legend: {
-
+            onClick: newLegendClickHandler
         }
     }
 });
index 939936769fcbe5ac18d3a8c9ca98ea3832ef8b7f..f7033790d1f95adb0776f33b839afee87f02bf7f 100644 (file)
@@ -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
-| -----| ---- | --------| -----------
-| `display` | `Boolean` | `false` | Is the title shown?
-| `position` | `String` | `'top'` | Position of title. [more...](#position)
-| `fontSize` | `Number` | `12` | Font size.
-| `fontFamily` | `String` |  `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the title text.
+| ---- | ---- | ------- | -----------
+| `display` | `boolean` | `false` | Is the title shown?
+| `position` | `string` | `'top'` | Position of title. [more...](#position)
+| `fontSize` | `number` | `12` | Font size.
+| `fontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Font family for the title text.
 | `fontColor` | `Color` | `'#666'` | Font color.
-| `fontStyle` | `String` | `'bold'` | Font style.
-| `padding` | `Number` | `10` | Number of pixels to add above and below the title text.
-| `lineHeight` | `Number/String` | `1.2` | Height of an individual line of text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height).
-| `text` | `String/String[]` | `''` | Title text to display. If specified as an array, text is rendered on multiple lines.
+| `fontStyle` | `string` | `'bold'` | Font style.
+| `padding` | `number` | `10` | Number of pixels to add above and below the title text.
+| `lineHeight` | <code>number&#124;string</code> | `1.2` | Height of an individual line of text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height).
+| `text` | <code>string&#124;string[]</code> | `''` | Title text to display. If specified as an array, text is rendered on multiple lines.
 
 ### Position
 Possible title position values are:
@@ -38,5 +38,5 @@ var chart = new Chart(ctx, {
             text: 'Custom Chart Title'
         }
     }
-})
+});
 ```
index 891d6e1e63295b81e716f0174180574e5f0d9e4e..2014dcdac9ccc57ff91858937a714445e4c31955 100644 (file)
@@ -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 tooltips enabled?
-| `custom` | `Function` | `null` | See [custom tooltip](#external-custom-tooltips) section.
-| `mode` | `String` | `'nearest'` | Sets which elements appear in the tooltip. [more...](../general/interactions/modes.md#interaction-modes).
-| `intersect` | `Boolean` | `true` | If true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times.
-| `position` | `String` | `'average'` | The mode for positioning the tooltip. [more...](#position-modes)
-| `callbacks` | `Object` | | See the [callbacks section](#tooltip-callbacks).
-| `itemSort` | `Function` | | Sort tooltip items. [more...](#sort-callback)
-| `filter` | `Function` | | Filter tooltip items. [more...](#filter-callback)
-| `backgroundColor` | `Color` | `'rgba(0,0,0,0.8)'` | Background color of the tooltip.
-| `titleFontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Title font.
-| `titleFontSize` | `Number` | `12` | Title font size.
-| `titleFontStyle` | `String` | `'bold'` | Title font style.
+| ---- | ---- | ------- | -----------
+| `enabled` | `boolean` | `true` | Are on-canvas tooltips enabled?
+| `custom` | `function` | `null` | See [custom tooltip](#external-custom-tooltips) section.
+| `mode` | `string` | `'nearest'` | Sets which elements appear in the tooltip. [more...](../general/interactions/modes.md#interaction-modes).
+| `intersect` | `boolean` | `true` | If true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times.
+| `position` | `string` | `'average'` | The mode for positioning the tooltip. [more...](#position-modes)
+| `callbacks` | `object` | | See the [callbacks section](#tooltip-callbacks).
+| `itemSort` | `function` | | Sort tooltip items. [more...](#sort-callback)
+| `filter` | `function` | | Filter tooltip items. [more...](#filter-callback)
+| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.8)'` | Background color of the tooltip.
+| `titleFontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Title font.
+| `titleFontSize` | `number` | `12` | Title font size.
+| `titleFontStyle` | `string` | `'bold'` | Title font style.
 | `titleFontColor` | `Color` | `'#fff'` | Title font color.
-| `titleSpacing` | `Number` | `2` | Spacing to add to top and bottom of each title line.
-| `titleMarginBottom` | `Number` | `6` | Margin to add on bottom of title section.
-| `bodyFontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Body line font.
-| `bodyFontSize` | `Number` | `12` | Body font size.
-| `bodyFontStyle` | `String` | `'normal'` | Body font style.
+| `titleSpacing` | `number` | `2` | Spacing to add to top and bottom of each title line.
+| `titleMarginBottom` | `number` | `6` | Margin to add on bottom of title section.
+| `bodyFontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Body line font.
+| `bodyFontSize` | `number` | `12` | Body font size.
+| `bodyFontStyle` | `string` | `'normal'` | Body font style.
 | `bodyFontColor` | `Color` | `'#fff'` | Body font color.
-| `bodySpacing` | `Number` | `2` | Spacing to add to top and bottom of each tooltip item.
-| `footerFontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Footer font.
-| `footerFontSize` | `Number` | `12` | Footer font size.
-| `footerFontStyle` | `String` | `'bold'` | Footer font style.
+| `bodySpacing` | `number` | `2` | Spacing to add to top and bottom of each tooltip item.
+| `footerFontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Footer font.
+| `footerFontSize` | `number` | `12` | Footer font size.
+| `footerFontStyle` | `string` | `'bold'` | Footer font style.
 | `footerFontColor` | `Color` | `'#fff'` | Footer font color.
-| `footerSpacing` | `Number` | `2` | Spacing to add to top and bottom of each footer line.
-| `footerMarginTop` | `Number` | `6` | Margin to add before drawing the footer.
-| `xPadding` | `Number` | `6` | Padding to add on left and right of tooltip.
-| `yPadding` | `Number` | `6` | Padding to add on top and bottom of tooltip.
-| `caretPadding` | `Number` | `2` | Extra distance to move the end of the tooltip arrow away from the tooltip point.
-| `caretSize` | `Number` | `5` | Size, in px, of the tooltip arrow.
-| `cornerRadius` | `Number` | `6` | Radius of tooltip corner curves.
+| `footerSpacing` | `number` | `2` | Spacing to add to top and bottom of each footer line.
+| `footerMarginTop` | `number` | `6` | Margin to add before drawing the footer.
+| `xPadding` | `number` | `6` | Padding to add on left and right of tooltip.
+| `yPadding` | `number` | `6` | Padding to add on top and bottom of tooltip.
+| `caretPadding` | `number` | `2` | Extra distance to move the end of the tooltip arrow away from the tooltip point.
+| `caretSize` | `number` | `5` | Size, in px, of the tooltip arrow.
+| `cornerRadius` | `number` | `6` | Radius of tooltip corner curves.
 | `multiKeyBackground` | `Color` | `'#fff'` | Color to draw behind the colored boxes when multiple items are in the tooltip.
-| `displayColors` | `Boolean` | `true` | If true, color boxes are shown in the tooltip.
-| `borderColor` | `Color` | `'rgba(0,0,0,0)'` | Color of the border.
-| `borderWidth` | `Number` | `0` | Size of the border.
+| `displayColors` | `boolean` | `true` | If true, color boxes are shown in the tooltip.
+| `borderColor` | `Color` | `'rgba(0, 0, 0, 0)'` | Color of the border.
+| `borderWidth` | `number` | `0` | Size of the border.
 
 ### Position Modes
- Possible modes are:
-* 'average'
-* 'nearest'
 
-'average' mode will place the tooltip at the average position of the items displayed in the tooltip. 'nearest' will place the tooltip at the position of the element closest to the event position.
+Possible modes are:
+* `'average'`
+* `'nearest'`
 
-New modes can be defined by adding functions to the Chart.Tooltip.positioners map.
+`'average'` mode will place the tooltip at the average position of the items displayed in the tooltip. `'nearest'` will place the tooltip at the position of the element closest to the event position.
+
+New modes can be defined by adding functions to the `Chart.Tooltip.positioners` map.
 
 Example:
 ```javascript
@@ -70,7 +71,7 @@ Chart.Tooltip.positioners.custom = function(elements, eventPosition) {
         x: 0,
         y: 0
     };
-}
+};
 ```
 
 ### Sort Callback
@@ -83,29 +84,29 @@ Allows filtering of [tooltip items](#tooltip-item-interface). Must implement at
 
 ## Tooltip Callbacks
 
-The tooltip label configuration is nested below the tooltip configuration using the `callbacks` key. The tooltip has the following callbacks for providing text. For all functions, 'this' will be the tooltip object created from the Chart.Tooltip constructor.
+The tooltip label configuration is nested below the tooltip configuration using the `callbacks` key. The tooltip has the following callbacks for providing text. For all functions, `this` will be the tooltip object created from the `Chart.Tooltip` constructor.
 
-All functions are called with the same arguments: a [tooltip item](#tooltip-item-interface) and the data object passed to the chart. All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.
+All functions are called with the same arguments: a [tooltip item](#tooltip-item-interface) and the `data` object passed to the chart. All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.
 
 | Name | Arguments | Description
 | ---- | --------- | -----------
-| `beforeTitle` | `Array[tooltipItem], data` | Returns the text to render before the title.
-| `title` | `Array[tooltipItem], data` | Returns text to render as the title of the tooltip.
-| `afterTitle` | `Array[tooltipItem], data` | Returns text to render after the title.
-| `beforeBody` | `Array[tooltipItem], data` | Returns text to render before the body section.
-| `beforeLabel` | `tooltipItem, data` | Returns text to render before an individual label. This will be called for each item in the tooltip.
-| `label` | `tooltipItem, data` | Returns text to render for an individual item in the tooltip.
-| `labelColor` | `tooltipItem, chart` | Returns the colors to render for the tooltip item. [more...](#label-color-callback)
-| `labelTextColor` | `tooltipItem, chart` | Returns the colors for the text of the label for the tooltip item.
-| `afterLabel` | `tooltipItem, data` | Returns text to render after an individual label.
-| `afterBody` | `Array[tooltipItem], data` | Returns text to render after the body section.
-| `beforeFooter` | `Array[tooltipItem], data` | Returns text to render before the footer section.
-| `footer` | `Array[tooltipItem], data` | Returns text to render as the footer of the tooltip.
-| `afterFooter` | `Array[tooltipItem], data` | Text to render after the footer section.
+| `beforeTitle` | `TooltipItem[], object` | Returns the text to render before the title.
+| `title` | `TooltipItem[], object` | Returns text to render as the title of the tooltip.
+| `afterTitle` | `TooltipItem[], object` | Returns text to render after the title.
+| `beforeBody` | `TooltipItem[], object` | Returns text to render before the body section.
+| `beforeLabel` | `TooltipItem, object` | Returns text to render before an individual label. This will be called for each item in the tooltip.
+| `label` | `TooltipItem, object` | Returns text to render for an individual item in the tooltip. [more...](#label-callback)
+| `labelColor` | `TooltipItem, Chart` | Returns the colors to render for the tooltip item. [more...](#label-color-callback)
+| `labelTextColor` | `TooltipItem, Chart` | Returns the colors for the text of the label for the tooltip item.
+| `afterLabel` | `TooltipItem, object` | Returns text to render after an individual label.
+| `afterBody` | `TooltipItem[], object` | Returns text to render after the body section.
+| `beforeFooter` | `TooltipItem[], object` | Returns text to render before the footer section.
+| `footer` | `TooltipItem[], object` | Returns text to render as the footer of the tooltip.
+| `afterFooter` | `TooltipItem[], object` | Text to render after the footer section.
 
 ### Label Callback
 
-The label callback can change the text that displays for a given data point. A common example to round data values; the following example rounds the data to two decimal places.
+The `label` callback can change the text that displays for a given data point. A common example to round data values; the following example rounds the data to two decimal places.
 
 ```javascript
 var chart = new Chart(ctx, {
@@ -143,9 +144,9 @@ var chart = new Chart(ctx, {
                     return {
                         borderColor: 'rgb(255, 0, 0)',
                         backgroundColor: 'rgb(255, 0, 0)'
-                    }
+                    };
                 },
-                labelTextColor:function(tooltipItem, chart){
+                labelTextColor: function(tooltipItem, chart) {
                     return '#543453';
                 }
             }
@@ -162,22 +163,22 @@ The tooltip items passed to the tooltip callbacks implement the following interf
 ```javascript
 {
     // X Value of the tooltip as a string
-    xLabel: String,
+    xLabel: string,
 
     // Y value of the tooltip as a string
-    yLabel: String,
+    yLabel: string,
 
     // Index of the dataset the item comes from
-    datasetIndex: Number,
+    datasetIndex: number,
 
     // Index of this data item in the dataset
-    index: Number,
+    index: number,
 
     // X position of matching point
-    x: Number,
+    x: number,
 
     // Y position of matching point
-    y: Number,
+    y: number
 }
 ```
 
@@ -202,7 +203,7 @@ var myPieChart = new Chart(ctx, {
                 if (!tooltipEl) {
                     tooltipEl = document.createElement('div');
                     tooltipEl.id = 'chartjs-tooltip';
-                    tooltipEl.innerHTML = "<table></table>";
+                    tooltipEl.innerHTML = '<table></table>';
                     document.body.appendChild(tooltipEl);
                 }
 
@@ -280,71 +281,75 @@ The tooltip model contains parameters that can be used to render the tooltip.
     dataPoints: TooltipItem[],
 
     // Positioning
-    xPadding: Number,
-    yPadding: Number,
-    xAlign: String,
-    yAlign: String,
+    xPadding: number,
+    yPadding: number,
+    xAlign: string,
+    yAlign: string,
 
     // X and Y properties are the top left of the tooltip
-    x: Number,
-    y: Number,
-    width: Number,
-    height: Number,
+    x: number,
+    y: number,
+    width: number,
+    height: number,
     // Where the tooltip points to
-    caretX: Number,
-    caretY: Number,
+    caretX: number,
+    caretY: number,
 
     // Body
     // The body lines that need to be rendered
     // Each object contains 3 parameters
-    // before: String[] // lines of text before the line with the color square
-    // lines: String[], // lines of text to render as the main item with color square
-    // after: String[], // lines of text to render after the main lines
-    body: Object[],
+    // before: string[] // lines of text before the line with the color square
+    // lines: string[], // lines of text to render as the main item with color square
+    // after: string[], // lines of text to render after the main lines
+    body: object[],
     // lines of text that appear after the title but before the body
-    beforeBody: String[],
+    beforeBody: string[],
     // line of text that appear after the body and before the footer
-    afterBody: String[],
+    afterBody: string[],
     bodyFontColor: Color,
-    _bodyFontFamily: String,
-    _bodyFontStyle: String,
-    _bodyAlign: String,
-    bodyFontSize: Number,
-    bodySpacing: Number,
+    _bodyFontFamily: string,
+    _bodyFontStyle: string,
+    _bodyAlign: string,
+    bodyFontSize: number,
+    bodySpacing: number,
 
     // Title
     // lines of text that form the title
-    title: String[],
+    title: string[],
     titleFontColor: Color,
-    _titleFontFamily: String,
-    _titleFontStyle: String,
-    titleFontSize: Number,
-    _titleAlign: String,
-    titleSpacing: Number,
-    titleMarginBottom: Number,
+    _titleFontFamily: string,
+    _titleFontStyle: string,
+    titleFontSize: number,
+    _titleAlign: string,
+    titleSpacing: number,
+    titleMarginBottom: number,
 
     // Footer
     // lines of text that form the footer
-    footer: String[],
+    footer: string[],
     footerFontColor: Color,
-    _footerFontFamily: String,
-    _footerFontStyle: String,
-    footerFontSize: Number,
-    _footerAlign: String,
-    footerSpacing: Number,
-    footerMarginTop: Number,
+    _footerFontFamily: string,
+    _footerFontStyle: string,
+    footerFontSize: number,
+    _footerAlign: string,
+    footerSpacing: number,
+    footerMarginTop: number,
 
     // Appearance
-    caretSize: Number,
-    cornerRadius: Number,
+    caretSize: number,
+    caretPadding: number,
+    cornerRadius: number,
     backgroundColor: Color,
 
     // colors to render for each item in body[]. This is the color of the squares in the tooltip
     labelColors: Color[],
+    labelTextColors: Color[],
 
     // 0 opacity is a hidden tooltip
-    opacity: Number,
+    opacity: number,
     legendColorBackground: Color,
-    displayColors: Boolean,
+    displayColors: boolean,
+    borderColor: Color,
+    borderWidth: number
 }
 ```
index 7d0156203f02d6f3b2c2191882fb3f01dc58bc30..e248db3a5722ec3a22f098cb4b5d3ff76a7a844d 100644 (file)
@@ -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 prototype methods on the shared chart type 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.
 
 ```javascript
 // For example:
@@ -42,7 +42,7 @@ Example:
 myChart.update({
     duration: 800,
     easing: 'easeOutBounce'
-})
+});
 ```
 
 See [Updating Charts](updates.md) for more details.
@@ -65,9 +65,9 @@ See `.update(config)` for more details on the config object.
 // duration is the time for the animation of the redraw in milliseconds
 // lazy is a boolean. if true, the animation can be interrupted by other animations
 myLineChart.render({
-       duration: 800,
-       lazy: false,
-       easing: 'easeOutBounce'
+    duration: 800,
+    lazy: false,
+    easing: 'easeOutBounce'
 });
 ```
 
@@ -148,7 +148,7 @@ Looks for the element under the event point, then returns all elements at the sa
 Calling `getElementsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the point elements that are at that the same position of that event.
 
 ```javascript
-canvas.onclick = function(evt){
+canvas.onclick = function(evt) {
     var activePoints = myLineChart.getElementsAtEvent(evt);
     // => activePoints is an array of points on the canvas that are at the same position as the click event.
 };
@@ -175,5 +175,5 @@ Extensive examples of usage are available in the [Chart.js tests](https://github
 
 ```javascript
 var meta = myChart.getDatasetMeta(0);
-var x = meta.data[0]._model.x
+var x = meta.data[0]._model.x;
 ```
index 7d6c74e32c943c4005ad631e7035e4b7f8af266d..682e93ea91987ef87eb3851a686664b3c1b5ab0e 100644 (file)
@@ -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 MyScale = Chart.Scale.extend({
@@ -29,7 +29,7 @@ var lineChart = new Chart(ctx, {
             }]
         }
     }
-})
+});
 ```
 
 ## Scale Properties
@@ -38,26 +38,26 @@ Scale instances are given the following properties during the fitting process.
 
 ```javascript
 {
-    left: Number, // left edge of the scale bounding box
-    right: Number, // right edge of the bounding box'
-    top: Number,
-    bottom: Number,
-    width: Number, // the same as right - left
-    height: Number, // the same as bottom - top
+    left: number, // left edge of the scale bounding box
+    right: number, // right edge of the bounding box
+    top: number,
+    bottom: number,
+    width: number, // the same as right - left
+    height: number, // the same as bottom - top
 
     // Margin on each side. Like css, this is outside the bounding box.
     margins: {
-        left: Number,
-        right: Number,
-        top: Number,
-        bottom: Number,
+        left: number,
+        right: number,
+        top: number,
+        bottom: number
     },
 
     // Amount of padding on the inside of the bounding box (like CSS)
-    paddingLeft: Number,
-    paddingRight: Number,
-    paddingTop: Number,
-    paddingBottom: Number,
+    paddingLeft: number,
+    paddingRight: number,
+    paddingTop: number,
+    paddingBottom: number
 }
 ```
 
@@ -78,15 +78,13 @@ To work with Chart.js, custom scale types must implement the following interface
 
     // Get the pixel (x coordinate for horizontal axis, y coordinate for vertical axis) for a given value
     // @param index: index into the ticks array
-    // @param includeOffset: if true, get the pixel halfway between the given tick and the next
-    getPixelForTick: function(index, includeOffset) {},
+    getPixelForTick: function(index) {},
 
     // Get the pixel (x coordinate for horizontal axis, y coordinate for vertical axis) for a given value
     // @param value : the value to get the pixel for
     // @param index : index into the data array of the value
     // @param datasetIndex : index of the dataset the value comes from
-    // @param includeOffset : if true, get the pixel halfway between the given tick and the next
-    getPixelForValue: function(value, index, datasetIndex, includeOffset) {}
+    getPixelForValue: function(value, index, datasetIndex) {},
 
     // Get the value for a given pixel (x coordinate for horizontal axis, y coordinate for vertical axis)
     // @param pixel : pixel value
@@ -97,6 +95,7 @@ To work with Chart.js, custom scale types must implement the following interface
 Optionally, the following methods may also be overwritten, but an implementation is already provided by the `Chart.Scale` base class.
 
 ```javascript
+{
     // Transform the ticks array of the scale instance into strings. The default implementation simply calls this.options.ticks.callback(numericalTick, index, ticks);
     convertTicksToLabels: function() {},
 
@@ -112,7 +111,8 @@ Optionally, the following methods may also be overwritten, but an implementation
 
     // Draws the scale onto the canvas. this.(left|right|top|bottom) will have been populated to tell you the area on the canvas to draw in
     // @param chartArea : an object containing four properties: left, right, top, bottom. This is the rectangle that lines, bars, etc will be drawn in. It may be used, for example, to draw grid lines.
-    draw: function(chartArea) {},
+    draw: function(chartArea) {}
+}
 ```
 
 The Core.Scale base class also has some utility functions that you may find useful.
@@ -125,7 +125,10 @@ The Core.Scale base class also has some utility functions that you may find usef
     // If dataValue is an object, returns .x or .y depending on the return of isHorizontal()
     // If the value is undefined, returns NaN
     // Otherwise returns the value.
-    // Note that in all cases, the returned value is not guaranteed to be a Number
+    // Note that in all cases, the returned value is not guaranteed to be a number
     getRightValue: function(dataValue) {},
+
+    // Returns the scale tick objects ({label, major})
+    getTicks: function() {}
 }
-```
\ No newline at end of file
+```
index ec6b6ffdbf762dcd2ec2cb81de278affd1a9129b..bf63b5f02938db77c921c6e27fc42931e2cb4b7d 100644 (file)
@@ -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) {}
 }
 ```
 
@@ -108,9 +108,9 @@ Chart.controllers.derivedBubble = custom;
 new Chart(ctx, {
     type: 'derivedBubble',
     data: data,
-    options: options,
+    options: options
 });
 ```
 
 ### Bar Controller
-The bar controller has a special property that you should be aware of. To correctly calculate the width of a bar, the controller must determine the number of datasets that map to bars. To do this, the bar controller attaches a property `bar` to the dataset during initialization. If you are creating a replacement or updated bar controller, you should do the same. This will ensure that charts with regular bars and your new derived bars will work seamlessly.
\ No newline at end of file
+The bar controller has a special property that you should be aware of. To correctly calculate the width of a bar, the controller must determine the number of datasets that map to bars. To do this, the bar controller attaches a property `bar` to the dataset during initialization. If you are creating a replacement or updated bar controller, you should do the same. This will ensure that charts with regular bars and your new derived bars will work seamlessly.
index e0310d171b40cecaa478c6a3cad7c620a34c92fd..ca849a96ff3882d5be333dcb43c6da27a1230cf9 100644 (file)
@@ -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-slack.herokuapp.com/). If you think you can help, we'd love to have you!
+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-slack.herokuapp.com/). If you think you can help, we'd love to have you!
 
 # Building and Testing
 
index cc4284f8f0b498dbcfc4f6407570bba308d3dd26..a935fe2fe74420864adbfa9c59cf3dd2907400a0 100644 (file)
@@ -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({
 });
 
 var chart = new Chart(ctx, {
-    config: {
+    options: {
         plugins: {
             p1: false   // disable plugin 'p1' for this instance
         }
@@ -106,27 +106,27 @@ var chart = new Chart(ctx, {
 
 ## Plugin Core API
 
-Available hooks (as of version 2.6):
-
-* beforeInit
-* afterInit
-* beforeUpdate *(cancellable)*
-* afterUpdate
-* beforeLayout *(cancellable)*
-* afterLayout
-* beforeDatasetsUpdate *(cancellable)*
-* afterDatasetsUpdate
-* beforeDatasetUpdate *(cancellable)*
-* afterDatasetUpdate
-* beforeRender *(cancellable)*
-* afterRender
-* beforeDraw *(cancellable)*
-* afterDraw
-* beforeDatasetsDraw *(cancellable)*
-* afterDatasetsDraw
-* beforeDatasetDraw *(cancellable)*
-* afterDatasetDraw
-* beforeEvent *(cancellable)*
-* afterEvent
-* resize
-* destroy
+Available hooks (as of version 2.7):
+
+* `beforeInit`
+* `afterInit`
+* `beforeUpdate` *(cancellable)*
+* `afterUpdate`
+* `beforeLayout` *(cancellable)*
+* `afterLayout`
+* `beforeDatasetsUpdate` *(cancellable)*
+* `afterDatasetsUpdate`
+* `beforeDatasetUpdate` *(cancellable)*
+* `afterDatasetUpdate`
+* `beforeRender` *(cancellable)*
+* `afterRender`
+* `beforeDraw` *(cancellable)*
+* `afterDraw`
+* `beforeDatasetsDraw` *(cancellable)*
+* `afterDatasetsDraw`
+* `beforeDatasetDraw` *(cancellable)*
+* `afterDatasetDraw`
+* `beforeEvent` *(cancellable)*
+* `afterEvent`
+* `resize`
+* `destroy`
index b65757f856b9eefc4412a4c777d5a26a5a6141a5..f515a3a3f643567e9a53d7fa7e8a2fb4708209af 100644 (file)
@@ -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 @@ function updateConfigAsNewObject(chart) {
                 display: true
             }]
         }
-    }
+    };
     chart.update();
 }
 ```
@@ -75,7 +75,7 @@ function updateScales(chart) {
             display: true,
             type: 'logarithmic'
         }]
-    }
+    };
     chart.update();
     // need to update the reference
     xScale = chart.scales['newId'];
@@ -89,7 +89,7 @@ You can also update a specific scale either by specifying its index or id.
 function updateScale(chart) {
     chart.options.scales.yAxes[0] = {
         type: 'logarithmic'
-    }
+    };
     chart.update();
 }
 ```
@@ -98,4 +98,4 @@ Code sample for updating options can be found in [toggle-scale-type.html](../../
 
 ## Preventing Animations
 
-Sometimes when a chart updates, you may not want an animation. To achieve this you can call `update` with a duration of `0`. This will render the chart synchronously and without an animation.
\ No newline at end of file
+Sometimes when a chart updates, you may not want an animation. To achieve this you can call `update` with a duration of `0`. This will render the chart synchronously and without an animation.
index a59df93475a27e90d10691db1c629d3392251789..fddff7cbe3f3dbe6c54897c451880fce7beab31c 100644 (file)
@@ -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 `canvas`, the accessibility has to be added with `ARIA` attributes on the `canvas` element or added using internal fallback content placed within the opening and closing canvas tags.
+With `canvas`, the accessibility has to be added with ARIA attributes on the `canvas` element or added using internal fallback content placed within the opening and closing canvas tags.
 
 This [website](http://pauljadam.com/demos/canvas.html) has a more detailed explanation of `canvas` accessibility as well as in depth examples.
 
@@ -20,7 +20,7 @@ This `canvas` element has a text alternative via fallback content.
 
 ```html
 <canvas id="okCanvas2" width="400" height="100">
-  <p>Hello Fallback World</p>
+    <p>Hello Fallback World</p>
 </canvas>
 ```
 
index 1e144d459a75ea3f5c3ab487b54af5c4ef15e5c9..12d700d7d49bccd2e71d5f908926e90360f88d65 100644 (file)
@@ -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://betweentwobrackets.com/data-graphics-and-colour-vision/).
@@ -41,9 +41,9 @@ var chartData = {
             pattern.draw('square', '#ff6384'),
             pattern.draw('circle', '#36a2eb'),
             pattern.draw('diamond', '#cc65fe'),
-            pattern.draw('triangle', '#ffce56'),
+            pattern.draw('triangle', '#ffce56')
         ]
     }],
     labels: ['Red', 'Blue', 'Purple', 'Yellow']
 };
-```
\ No newline at end of file
+```
index ae82e7a6ef9c06e220d99ebdbd8aebf29fc43e01..6e6e96ecff1c3d06bbb1897bc98f576276d51369 100644 (file)
@@ -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` | `window.devicePixelRatio` | Override the window's default devicePixelRatio.
index f00c5aa53737526bb2f3df640748299792e61f57..a476ca894a25b52a324ff8c5d40aa0710e12b168 100644 (file)
@@ -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 all text.
-| `defaultFontSize` | `Number` | `12` | Default font size (in px) for text. Does not apply to radialLinear scale point labels.
-| `defaultFontStyle` | `String` | `'normal'` | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title.
+| `defaultFontFamily` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Default font family for all text.
+| `defaultFontSize` | `number` | `12` | Default font size (in px) for text. Does not apply to radialLinear scale point labels.
+| `defaultFontStyle` | `string` | `'normal'` | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title.
 
 ## Missing Fonts
 
index f88c9e4108778dbdc93398a394d8af0c8fb06e5e..9b5ad6d3271a54161250530ac8345e407e49fdee 100644 (file)
@@ -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 details.
-| `intersect` | `Boolean` | `true` | if true, the hover mode only applies when the mouse position intersects an item on the chart.
-| `axis` | `String` | `'x'` | Can be set to `'x'`, `'y'`, or `'xy'` to define which directions are used in calculating distances. Defaults to `'x'` for `index` mode and `'xy'` in `dataset` and `nearest` modes.
-| `animationDuration` | `Number` | `400` | Duration in milliseconds it takes to animate hover style changes.
+| `mode` | `string` | `'nearest'` | Sets which elements appear in the tooltip. See [Interaction Modes](./modes.md#interaction-modes) for details.
+| `intersect` | `boolean` | `true` | if true, the hover mode only applies when the mouse position intersects an item on the chart.
+| `axis` | `string` | `'x'` | Can be set to `'x'`, `'y'`, or `'xy'` to define which directions are used in calculating distances. Defaults to `'x'` for `'index'` mode and `'xy'` in `dataset` and `'nearest'` modes.
+| `animationDuration` | `number` | `400` | Duration in milliseconds it takes to animate hover style changes.
index 2d5759cea62cfdf3c26f4fa0d005770d53c9f70c..51e3bf4b84b7171076503812af7d22f4f8b9f5b8 100644 (file)
@@ -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 that the chart should listen to for tooltips and hovering. [more...](#event-option)
-| `onHover` | `Function` | `null` | Called when any of the events fire. Called in the context of the chart and passed the event and an array of active elements (bars, points, etc).
-| `onClick` | `Function` | `null` | Called if the event is of type 'mouseup' or 'click'. Called in the context of the chart and passed the event and an array of active elements.
+| `events` | `string[]` | `['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove']` | The `events` option defines the browser events that the chart should listen to for tooltips and hovering. [more...](#event-option)
+| `onHover` | `function` | `null` | Called when any of the events fire. Called in the context of the chart and passed the event and an array of active elements (bars, points, etc).
+| `onClick` | `function` | `null` | Called if the event is of type `'mouseup'` or `'click'`. Called in the context of the chart and passed the event and an array of active elements.
 
 ## Event Option
 For example, to have the chart only respond to click events, you could do:
index d6a8c261fba2814aa0ceed71b225c85735cebd10..2398908356a1b57311f88bc4e2a3520ecc00031c 100644 (file)
@@ -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. Behaves like 'nearest' mode with intersect = true.
+Finds the first item that intersects the point and returns it. Behaves like `'nearest'` mode with `intersect = true`.
 
 ## label (deprecated)
 See `'index'` mode.
@@ -52,7 +52,7 @@ var chart = new Chart(ctx, {
             mode: 'index'
         }
     }
-})
+});
 ```
 
 To use index mode in a chart like the horizontal bar chart, where we search along the y direction, you can use the `axis` setting introduced in v2.7.0. By setting this value to `'y'` on the y direction is used.
@@ -67,7 +67,7 @@ var chart = new Chart(ctx, {
             axis: 'y'
         }
     }
-})
+});
 ```
 
 ## x-axis (deprecated)
@@ -85,7 +85,7 @@ var chart = new Chart(ctx, {
             mode: 'dataset'
         }
     }
-})
+});
 ```
 
 ## x
@@ -100,7 +100,7 @@ var chart = new Chart(ctx, {
             mode: 'x'
         }
     }
-})
+});
 ```
 
 ## y
@@ -115,5 +115,5 @@ var chart = new Chart(ctx, {
             mode: 'y'
         }
     }
-})
-```
\ No newline at end of file
+});
+```
index a85c57bd6328d0b99f067a56f7dea8c406e1e872..319709a5a16e3a63c7210a59f5faea7a1dbe8a63 100644 (file)
@@ -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)).
-| `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)` when resizing.
-| `aspectRatio` | `Number` | `2` | Canvas aspect ratio (i.e. `width / height`, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style.
-| `onResize` | `Function` | `null` | Called when a resize occurs. Gets passed two arguments: the chart instance and the new size.
+| `responsive` | `boolean` | `true` | Resizes the chart canvas when its container does ([important note...](#important-note)).
+| `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)` when resizing.
+| `aspectRatio` | `number` | `2` | Canvas aspect ratio (i.e. `width / height`, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style.
+| `onResize` | `function` | `null` | Called when a resize occurs. Gets passed two arguments: the chart instance and the new size.
 
 ## Important Note
 
-Detecting when the canvas size changes can not be done directly from the `CANVAS` element. Chart.js uses its parent container to update the canvas *render* and *display* sizes. However, this method requires the container to be **relatively positioned** and **dedicated to the chart canvas only**. Responsiveness can then be achieved by setting relative values for the container size ([example](https://codepen.io/chartjs/pen/YVWZbz)):
+Detecting when the canvas size changes can not be done directly from the `canvas` element. Chart.js uses its parent container to update the canvas *render* and *display* sizes. However, this method requires the container to be **relatively positioned** and **dedicated to the chart canvas only**. Responsiveness can then be achieved by setting relative values for the container size ([example](https://codepen.io/chartjs/pen/YVWZbz)):
 
 ```html
 <div class="chart-container" style="position: relative; height:40vh; width:80vw">
@@ -44,8 +44,8 @@ CSS media queries allow changing styles when printing a page. The CSS applied fr
 
 ```javascript
 function beforePrintHandler () {
-  for (var id in Chart.instances) {
-    Chart.instances[id].resize()
-  }
+    for (var id in Chart.instances) {
+        Chart.instances[id].resize();
+    }
 }
 ```
index bff52c72dd6fde920ff8a5e1ffea0960a5626ff4..5a879c4ce5102b5b3dc9a9319a4c0c78701fd8af 100644 (file)
@@ -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.min.js"></script>
 ```
 
 Now, we can create a chart. We add a script to our page:
@@ -24,12 +24,12 @@ var chart = new Chart(ctx, {
 
     // The data for our dataset
     data: {
-        labels: ["January", "February", "March", "April", "May", "June", "July"],
+        labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
         datasets: [{
-            label: "My First dataset",
+            label: 'My First dataset',
             backgroundColor: 'rgb(255, 99, 132)',
             borderColor: 'rgb(255, 99, 132)',
-            data: [0, 10, 5, 2, 20, 30, 45],
+            data: [0, 10, 5, 2, 20, 30, 45]
         }]
     },
 
@@ -40,4 +40,4 @@ var chart = new Chart(ctx, {
 
 It's that easy to get started using Chart.js! From here you can explore the many options that can help you customise your charts with scales, tooltips, labels, colors, custom actions, and much more.
 
-There are many examples of Chart.js that are available in the `/samples` folder of `Chart.js.zip` that is attached to every [release](https://github.com/chartjs/Chart.js/releases).
\ No newline at end of file
+All our examples are [available online](https://www.chartjs.org/samples/latest/) but you can also download the `Chart.js.zip` archive attached to every [release](https://github.com/chartjs/Chart.js/releases) to experiment with our samples locally from the `/samples` folder.
index ea9daea23508102fc0ca96714723c577b5c7392b..783bd13109c65a5387db9289ab8a5d60c8a300d5 100644 (file)
@@ -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**, **Bundled Build**.
 
 ## Stand-Alone Build
 Files:
@@ -54,4 +54,4 @@ Files:
 * `dist/Chart.bundle.js`
 * `dist/Chart.bundle.min.js`
 
-The bundled build includes Moment.js in a single file. You should use this version if you require time axes and want to include a single file. You should not use this build if your application already included Moment.js. Otherwise, Moment.js will be included twice which results in increasing page load time and possible version compatability issues. The Moment.js version in the bundled build is private to Chart.js so if you want to use Moment.js yourself, it's better to use Chart.js (non bundled) and import Moment.js manually.
+The bundled build includes Moment.js in a single file. You should use this version if you require time axes and want to include a single file. You should not use this build if your application already included Moment.js. Otherwise, Moment.js will be included twice which results in increasing page load time and possible version compatibility issues. The Moment.js version in the bundled build is private to Chart.js so if you want to use Moment.js yourself, it's better to use Chart.js (non bundled) and import Moment.js manually.
index 95ccbc46d0ae65a3dde575e0e6f7ccc7f4395be9..285bf195b922041eaf0edc9e30f390e2dea38862 100644 (file)
@@ -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 module as is](http://www.requirejs.org/docs/commonjs.html#intro), so be sure to require one of the built UMD files instead (i.e. `dist/Chart.js`, `dist/Chart.min.js`, etc.).
+> **Important:** RequireJS [can **not** load CommonJS module as is](https://requirejs.org/docs/commonjs.html#intro), so be sure to require one of the built UMD files instead (i.e. `dist/Chart.js`, `dist/Chart.min.js`, etc.).
index 739c838596c05aa10370219cce17c6bf3c121e92..0a0d48b99628627184c852aee1d306dfad5c69a2 100644 (file)
@@ -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";
+var ctx = document.getElementById('myChart');
+var ctx = document.getElementById('myChart').getContext('2d');
+var ctx = $('#myChart');
+var ctx = 'myChart';
 ```
 
 Once you have the element or context, you're ready to instantiate a pre-defined chart-type or create your own!
@@ -24,11 +24,11 @@ The following example instantiates a bar chart showing the number of votes for d
 ```html
 <canvas id="myChart" width="400" height="400"></canvas>
 <script>
-var ctx = document.getElementById("myChart");
+var ctx = document.getElementById('myChart');
 var myChart = new Chart(ctx, {
     type: 'bar',
     data: {
-        labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
+        labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
         datasets: [{
             label: '# of Votes',
             data: [12, 19, 3, 5, 2, 3],
@@ -41,7 +41,7 @@ var myChart = new Chart(ctx, {
                 'rgba(255, 159, 64, 0.2)'
             ],
             borderColor: [
-                'rgba(255,99,132,1)',
+                'rgba(255, 99, 132, 1)',
                 'rgba(54, 162, 235, 1)',
                 'rgba(255, 206, 86, 1)',
                 'rgba(75, 192, 192, 1)',
@@ -55,11 +55,11 @@ var myChart = new Chart(ctx, {
         scales: {
             yAxes: [{
                 ticks: {
-                    beginAtZero:true
+                    beginAtZero: true
                 }
             }]
         }
     }
 });
 </script>
-```
\ No newline at end of file
+```
index 2795faebc851b42231b13f0a9217fc1ff6d258af..94d9a69f2b2948f1ef6c4a0987b6881dc6d401e3 100644 (file)
@@ -1 +1 @@
-# Additional Notes
\ No newline at end of file
+# Additional Notes
index 3cb9c99af83a96d8c2575d022396a97707e58ac7..b7a72316392808039c4e607e37535c5c0d2be883 100644 (file)
@@ -9,7 +9,7 @@ Library Features
 | SVG | | &check; | &check; | &check; |
 | Built-in Charts | &check; | | &check; | &check; |
 | 8+ Chart Types | &check; | &check; | &check; | |
-| Extendable to Custom Charts | &check; | &check; | |  |
+| Extendable to Custom Charts | &check; | &check; | | |
 | Supports Modern Browsers | &check; | &check; | &check; | &check; |
 | Extensive Documentation | &check; | &check; | &check; | &check; |
 | Open Source | &check; | &check; | | &check; |
@@ -24,9 +24,8 @@ Built in Chart Types
 | Horizontal Bar | &check; | &check; | &check; |
 | Pie/Doughnut | &check; | &check; | &check; |
 | Polar Area | &check; | &check; | |
-| Radar | &check; |  | |
+| Radar | &check; | | |
 | Scatter | &check; | &check; | &check; |
 | Bubble | &check; | | |
 | Gauges | | &check; | |
 | Maps (Heat/Tree/etc.) | | &check; | |
-
index 91d520a8ef56ee5b3be0ace12b1c25e086be5d42..f8f53f3d5647d1b17c95857efb3a6e3cbc9ee7f3 100644 (file)
@@ -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">omi-chart</a>
index 01a0a1da561716daffe6e7e337b18389a78ecd26..9bc3c679231f92060e5d9ec60d1e2af253502ad1 100644 (file)
@@ -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="_blank">open source</a> and available under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT license</a>.