From e54eee94e751ec21ca3ef8ea5384b46c28823691 Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Sun, 9 Jul 2017 16:12:27 +0800 Subject: [PATCH 1/4] Fix relative links in documentation of configurations --- docs/configuration/legend.md | 6 +++--- docs/configuration/tooltip.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/configuration/legend.md b/docs/configuration/legend.md index c398908b485..4cad48b556e 100644 --- a/docs/configuration/legend.md +++ b/docs/configuration/legend.md @@ -34,8 +34,8 @@ The legend label configuration is nested below the legend configuration using th | `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](#chart-configuration-legend-item-interface) for details. -| `filter` | `Function` | `null` | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#chart-configuration-legend-item-interface) and the chart data. +| `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 @@ -163,4 +163,4 @@ var chart = new Chart(ctx, { } } }); -``` \ No newline at end of file +``` diff --git a/docs/configuration/tooltip.md b/docs/configuration/tooltip.md index 8947d24633b..bb3b7a6aefb 100644 --- a/docs/configuration/tooltip.md +++ b/docs/configuration/tooltip.md @@ -7,7 +7,7 @@ The tooltip configuration is passed into the `options.tooltips` namespace. The g | Name | Type | Default | Description | -----| ---- | --------| ----------- | `enabled` | `Boolean` | `true` | Are tooltips enabled -| `custom` | `Function` | `null` | See [custom tooltip](#custom-tooltips) section. +| `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) @@ -53,17 +53,17 @@ New modes can be defined by adding functions to the Chart.Tooltip.positioners ma ### Sort Callback -Allows sorting of [tooltip items](#chart-configuration-tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). This function can also accept a third parameter that is the data object passed to the chart. +Allows sorting of [tooltip items](#tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). This function can also accept a third parameter that is the data object passed to the chart. ### Filter Callback -Allows filtering of [tooltip items](#chart-configuration-tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). This function can also accept a second parameter that is the data object passed to the chart. +Allows filtering of [tooltip items](#tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). This function can also accept a second parameter that is the data object passed to the chart. ## 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. -All functions are called with the same arguments: a [tooltip item](#chart-configuration-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 | ---- | --------- | ----------- From 338307e110938f317ef69393d9319c6cff3c3ca9 Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Sun, 9 Jul 2017 16:12:59 +0800 Subject: [PATCH 2/4] Fix relative link of 'Time Units' --- docs/axes/cartesian/time.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/axes/cartesian/time.md b/docs/axes/cartesian/time.md index 6b6aaa64f15..dc4a2bb42d0 100644 --- a/docs/axes/cartesian/time.md +++ b/docs/axes/cartesian/time.md @@ -13,9 +13,9 @@ The following options are provided by the time scale. They are all located in th | `max` | [Time](#date-formats) | | If defined, this will override the data maximum | `min` | [Time](#date-formats) | | If defined, this will override the data minimum | `parser` | `String` or `Function` | | Custom parser for dates. [more...](#parser) -| `round` | `String` | `false` | If defined, dates will be rounded to the start of this unit. See [Time Units](#scales-time-units) below for the allowed units. +| `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. | `tooltipFormat` | `String` | | The moment js format string to use for the tooltip. -| `unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#scales-time-units) section below for details. +| `unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#time-units) section below for details. | `stepSize` | `Number` | `1` | The number of units between grid lines. | `minUnit` | `String` | `'millisecond'` | The minimum display format to be used for a time unit. From 123bfc88d96c4f2d66305e9fe5bddd38c30a2dfc Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Sun, 9 Jul 2017 16:13:19 +0800 Subject: [PATCH 3/4] Fix relative links for chart types documentations --- docs/charts/bar.md | 12 ++++++------ docs/charts/bubble.md | 4 ++-- docs/charts/line.md | 4 ++-- docs/charts/polar.md | 4 ++-- docs/charts/radar.md | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/charts/bar.md b/docs/charts/bar.md index 32cc32e9e4f..4d5697ec8b0 100644 --- a/docs/charts/bar.md +++ b/docs/charts/bar.md @@ -73,7 +73,7 @@ Some properties can be specified as an array. If these are set to an array value | `backgroundColor` | `Color/Color[]` | The fill color of the bar. See [Colors](../general/colors.md#colors) | `borderColor` | `Color/Color[]` | The color of the bar border. See [Colors](../general/colors.md#colors) | `borderWidth` | `Number/Number[]` | The stroke width of the bar in pixels. -| `borderSkipped` | `String` | Which edge to skip drawing the border for. [more...](#borderSkipped) +| `borderSkipped` | `String` | Which edge to skip drawing the border for. [more...](#borderskipped) | `hoverBackgroundColor` | `Color/Color[]` | The fill colour of the bars when hovered. | `hoverBorderColor` | `Color/Color[]` | The stroke colour of the bars when hovered. | `hoverBorderWidth` | `Number/Number[]` | The stroke width of the bars when hovered. @@ -93,11 +93,11 @@ The bar chart defines the following configuration options. These options are mer | Name | Type | Default | Description | ---- | ---- | ------- | ----------- -| `barPercentage` | `Number` | `0.9` | Percent (0-1) of the available width each bar should be within the category percentage. 1.0 will take the whole category width and put the bars right next to each other. [more...](#bar-chart-barpercentage-vs-categorypercentage) -| `categoryPercentage` | `Number` | `0.8` | Percent (0-1) of the available width (the space between the gridlines for small datasets) for each data-point to use for the bars. [more...](#bar-chart-barpercentage-vs-categorypercentage) +| `barPercentage` | `Number` | `0.9` | Percent (0-1) of the available width each bar should be within the category percentage. 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 (the space between the gridlines for small datasets) for each data-point to use for the bars. [more...](#barpercentage-vs-categorypercentage) | `barThickness` | `Number` | | Manually set width of each bar in pixels. If not set, the bars are sized automatically using `barPercentage` and `categoryPercentage`; | `maxBarThickness` | `Number` | | Set this to ensure that the automatically sized bars are not sized thicker than this. Only works if barThickness is not set (automatic sizing is enabled). -| `gridLines.offsetGridLines` | `Boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. If false, the grid line will go right down the middle of the bars. [more...](#offsetGridLines) +| `gridLines.offsetGridLines` | `Boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines) ### offsetGridLines If true, the bars for a particular data point fall between the grid lines. If false, the grid line will go right down the middle of the bars. It is unlikely that this will ever need to be changed in practice. It exists more as a way to reuse the axis code by configuring the existing axis slightly differently. @@ -235,6 +235,6 @@ var myBarChart = new Chart(ctx, { ``` ## Config Options -The configuration options for the horizontal bar chart are the same as for the [bar chart](../bar/config-options.md#config-options). However, any options specified on the x axis in a bar chart, are applied to the y axis in a horizontal bar chart. +The configuration options for the horizontal bar chart are the same as for the [bar chart](#configuration-options). However, any options specified on the x axis in a bar chart, are applied to the y axis in a horizontal bar chart. -The default horizontal bar configuration is specified in `Chart.defaults.horizontalBar`. \ No newline at end of file +The default horizontal bar configuration is specified in `Chart.defaults.horizontalBar`. diff --git a/docs/charts/bubble.md b/docs/charts/bubble.md index d36f7eea41e..df96911c601 100644 --- a/docs/charts/bubble.md +++ b/docs/charts/bubble.md @@ -53,7 +53,7 @@ All properties, except `label` can be specified as an array. If these are set to ## Config Options -The bubble chart has no unique configuration options. To configure options common to all of the bubbles, the [point element options](../configuration/elements/point.md#point-configuration) are used. +The bubble chart has no unique configuration options. To configure options common to all of the bubbles, the [point element options](../configuration/elements.md#point-configuration) are used. ## Default Options @@ -78,4 +78,4 @@ Data for the bubble chart is passed in the form of an object. The object must im // Radius of bubble. This is not scaled. r: } -``` \ No newline at end of file +``` diff --git a/docs/charts/line.md b/docs/charts/line.md index b390d1187e0..4991911303b 100644 --- a/docs/charts/line.md +++ b/docs/charts/line.md @@ -55,14 +55,14 @@ All point* properties can be specified as an array. If these are set to an array | `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) -| `cubicInterpolationMode` | `String` | Algorithm used to interpolate a smooth curve from the discrete data points. [more...](#cubicInterpolationMode) +| `cubicInterpolationMode` | `String` | Algorithm used to interpolate a smooth curve from the discrete data points. [more...](#cubicinterpolationmode) | `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. This option is ignored if monotone cubic interpolation is used. | `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. -| `pointStyle` | `String/String[]/Image/Image[]` | Style of the point. [more...](#pointStyle) +| `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. diff --git a/docs/charts/polar.md b/docs/charts/polar.md index 4c55556f17a..29952cff672 100644 --- a/docs/charts/polar.md +++ b/docs/charts/polar.md @@ -56,7 +56,7 @@ The following options can be included in a polar area chart dataset to configure ## Config Options -These are the customisation options specific to Polar Area charts. These options are merged with the [global chart configuration options](#global-chart-configuration), and form the options of the chart. +These are the customisation options specific to Polar Area charts. These options are merged with the [global chart default options](#default-options), and form the options of the chart. | Name | Type | Default | Description | ---- | ---- | ------- | ----------- @@ -92,4 +92,4 @@ data = { 'Blue' ] }; -``` \ No newline at end of file +``` diff --git a/docs/charts/radar.md b/docs/charts/radar.md index dd5d47b27e4..592bb94ef5d 100644 --- a/docs/charts/radar.md +++ b/docs/charts/radar.md @@ -82,7 +82,7 @@ All point* properties can be specified as an array. If these are set to an array | `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. -| `pointStyle` | `String/String[]/Image/Image[]` | Style of the point. [more...](#pointStyle) +| `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. From 6feb7eceb5c671aa65b6fdf8004ce02f7b7647cb Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Sun, 9 Jul 2017 16:13:59 +0800 Subject: [PATCH 4/4] Fix the release version link in developers/plugins --- docs/developers/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers/plugins.md b/docs/developers/plugins.md index f0a1d95663d..cc4284f8f0b 100644 --- a/docs/developers/plugins.md +++ b/docs/developers/plugins.md @@ -1,6 +1,6 @@ # Plugins -Plugins are the most efficient way to customize or change the default behavior of a chart. They have been introduced at [version 2.1.0](https://github.com/chartjs/Chart.js/releases/tag/2.1.0) (global plugins only) and extended at [version 2.5.0](https://github.com/chartjs/Chart.js/releases/tag/2.5.0) (per chart plugins and options). +Plugins are the most efficient way to customize or change the default behavior of a chart. They have been introduced at [version 2.1.0](https://github.com/chartjs/Chart.js/releases/tag/2.1.0) (global plugins only) and extended at [version 2.5.0](https://github.com/chartjs/Chart.js/releases/tag/v2.5.0) (per chart plugins and options). ## Using plugins