Skip to content

Commit e610d7e

Browse files
author
Kumar Harsh
committed
docs: address issue with multi-dataset charts - closes #154
1 parent 15f1448 commit e610d7e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ Looks for the element under the event point, then returns all elements from that
203203
}
204204
```
205205

206+
### Working with Multiple Datasets
207+
208+
You will find that any event which causes the chart to re-render, such as hover tooltips, etc., will cause the first dataset to be copied over to other datasets, causing your lines and bars to merge together. This is because to track changes in the dataset series, the library needs a `key` to be specified - if none is found, it can't tell the difference between the datasets while updating. To get around this issue, you can take these two approaches:
209+
210+
1. Add a `label` property on each dataset. By default, this library uses the `label` property as the key to distinguish datasets.
211+
2. Specify a different property to be used as a key by passing a `datasetKeyProvider` prop to your chart component, which would return a unique string value for each dataset.
212+
206213
## Development (`src`, `lib` and the build process)
207214

208215
**NOTE:** The source code for the component is in `src`. A transpiled CommonJS version (generated with Babel) is available in `lib` for use with node.js, browserify and webpack. A UMD bundle is also built to `dist`, which can be included without the need for any build system.

0 commit comments

Comments
 (0)