Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Dec 5, 2021
1 parent bd0c40f commit 5724b77
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/configuration/index.md
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/interactions.md
Expand Up @@ -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

Expand Down
34 changes: 25 additions & 9 deletions docs/general/data-structures.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/tooltip/interactions.md
Expand Up @@ -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';
Expand Down

0 comments on commit 5724b77

Please sign in to comment.