From 5724b77012aaf1cdf83b473b59eca5ad8e44cf32 Mon Sep 17 00:00:00 2001 From: kurkle Date: Sun, 5 Dec 2021 18:03:19 +0200 Subject: [PATCH] Review update --- docs/configuration/index.md | 2 +- docs/configuration/interactions.md | 2 +- docs/general/data-structures.md | 34 ++++++++++++++++++++-------- docs/samples/tooltip/interactions.md | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/docs/configuration/index.md b/docs/configuration/index.md index d14717fc30e..bc75d7162e5 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -31,7 +31,7 @@ Majority of the documentation talks about these options. ### plugins -Inline plugines can be included in this array. It is an alternative way of adding plugins for single chart (vs registering the plugin globally). +Inline plugins can be included in this array. It is an alternative way of adding plugins for single chart (vs registering the plugin globally). More about plugins in the [developers section](../developers/plugins.md). ## Global Configuration diff --git a/docs/configuration/interactions.md b/docs/configuration/interactions.md index 6b830a671de..43dca6dd4c3 100644 --- a/docs/configuration/interactions.md +++ b/docs/configuration/interactions.md @@ -108,7 +108,7 @@ When configuring the interaction with the graph via `interaction`, `hover` or `t The modes are detailed below and how they behave in conjunction with the `intersect` setting. -See how different modes work with tooltip in [tooltip interactions sample](../samples/tooltip/interactions.md ) +See how different modes work with the tooltip in [tooltip interactions sample](../samples/tooltip/interactions.md ) ### point diff --git a/docs/general/data-structures.md b/docs/general/data-structures.md index 967801bb8e5..65b8775510e 100644 --- a/docs/general/data-structures.md +++ b/docs/general/data-structures.md @@ -7,29 +7,45 @@ The provides labels can be of the type string or number to be rendered correctly ## Primitive[] -Namespace: `data.datasets[]` - ```javascript -data: [20, 10], -labels: ['a', 'b'] +type: 'bar', +data: { + datasets: [{ + data: [20, 10], + }], + labels: ['a', 'b'] +} ``` When the `data` is an array of numbers, values from `labels` array at the same index are used for the index axis (`x` for vertical, `y` for horizontal charts). ## Object[] -Namespace: `data.datasets[]` - ```javascript -data: [{x: 10, y: 20}, {x: 15, y: null}, {x: 20, y: 10}] +type: 'line', +data: { + datasets: [{ + data: [{x: 10, y: 20}, {x: 15, y: null}, {x: 20, y: 10}] + }] +} ``` ```javascript -data: [{x:'2016-12-25', y:20}, {x:'2016-12-26', y:10}] +type: 'line', +data: { + datasets: [{ + data: [{x:'2016-12-25', y:20}, {x:'2016-12-26', y:10}] + }] +} ``` ```javascript -data: [{x:'Sales', y:20}, {x:'Revenue', y:10}] +type: 'bar', +data: { + datasets: [{ + data: [{x:'Sales', y:20}, {x:'Revenue', y:10}] + }] +} ``` This is also the internal format used for parsed data. In this mode, parsing can be disabled by specifying `parsing: false` at chart options or dataset. If parsing is disabled, data must be sorted and in the formats the associated chart type and scales use internally. diff --git a/docs/samples/tooltip/interactions.md b/docs/samples/tooltip/interactions.md index c2174538bc4..b28bbb46f68 100644 --- a/docs/samples/tooltip/interactions.md +++ b/docs/samples/tooltip/interactions.md @@ -30,7 +30,7 @@ const actions = [ } }, { - name: 'Mode: nearest, axis: yx', + name: 'Mode: nearest, axis: xy', handler(chart) { chart.options.interaction.axis = 'xy'; chart.options.interaction.mode = 'nearest';