From: wcatron Date: Fri, 20 Nov 2015 00:55:12 +0000 (-0500) Subject: Update line chart documentation options to table. X-Git-Tag: 2.0.0-beta1~13^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1580d1ed4d9ba77c8bf80dbe62393773a5347127;p=thirdparty%2FChart.js.git Update line chart documentation options to table. --- diff --git a/docs/02-Line-Chart.md b/docs/02-Line-Chart.md index 53c31a3ae..f31609f62 100644 --- a/docs/02-Line-Chart.md +++ b/docs/02-Line-Chart.md @@ -15,7 +15,7 @@ Often, it is used to show trend data, and the comparison of two data sets. ```javascript var myLineChart = new Chart(ctx, { type: 'line', - data: data, + data: data, options: options }); ``` @@ -23,7 +23,7 @@ var myLineChart = new Chart(ctx, { Alternatively a line chart can be created using syntax similar to the v1.0 syntax ```javascript var myLineChart = Chart.Line(ctx, { - data: data, + data: data, options: options }); ``` @@ -113,37 +113,22 @@ The label key on each dataset is optional, and can be used when generating a sca These are the customisation options specific to Line charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart. -```javascript -{ - // Boolean - if true, line stack on top of each other along the y axis - stacked: false, - - hover: { - // String - We use a label hover mode since the x axis displays data by the index in the dataset - mode: "label" - }, - - scales: { - // Defines all of the x axes used in the chart. See the [scale documentation](#getting-started-scales) for details on the available options - xAxes: [{ - // String - type of scale. Built in types are 'category' and 'linear' - type: 'category', - - // String - id of the axis so that data can bind to it - id: "x-axis-1", // need an ID so datasets can reference the scale - }], - - // Defines all of the y axes used in the chart. - // By default, the line chart uses a linear scale along the y axis - yAxes: [{ - type: 'linear', - - // String - ID of the axis for data binding - id: "y-axis-1", - }], - } -}; -``` +The default options for line chart are defined in `Chart.defaults.Line`. + +Name | Type | Default | Description +--- | --- | --- | --- +stacked | Boolean | false | If true, lines stack on top of each other along the y axis. +*hover*.mode | String | "label" | Label's hover mode. "label" is used since the x axis displays data by the index in the dataset. +scales | - | - | - +*scales*.xAxes | Array | `[{type:"category","id":"x-axis-1"}]` | Defines all of the x axes used in the chart. See the [scale documentation](#getting-started-scales) for details on the available options. +*Options for xAxes* | | | +type | String | "category" | Type of scale. Built in types are 'category' and 'linear'. +id | String | "x-axis-1" | Id of the axis so that data can bind to it. + | | | + *scales*.yAxes | Array | `[{type:"linear","id":"y-axis-1"}]` | Defines all of the x axes used in the chart. See the [scale documentation](#getting-started-scales) for details on the available options. + *Options for yAxes* | | | + type | String | "linear" | Type of scale. Built in types are 'category' and 'linear'. + id | String | "y-axis-1" | Id of the axis so that data can bind to it. You can override these for your `Chart` instance by passing a member `options` into the `Line` method. @@ -152,7 +137,7 @@ For example, we could have a line chart display without an x axis by doing the f ```javascript new Chart(ctx, { type: 'line', - data: data, + data: data, options: { xAxes: [{ show: false