Skip to content

Commit 5d3c776

Browse files
authored
Merge pull request #7 from vizzuhq/petervidos-patch-2
doc: adding new records
2 parents 61a2022 + ae0d399 commit 5d3c776

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

docs/content/tutorial/10-filtering.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## Filtering
1+
## Filtering & adding new records
22

33
Filtering enables you to zoom in or out within a chart, allowing the viewer to
4-
focus on certain selected elements, or add new ones to provide more context.
4+
focus on certain selected elements, or get more context.
5+
You can also add new records to the data on the chart which makes it easy to work
6+
with real-time sources.
57

68
We add two items from the Genres dimension - using the || operator - to
79
the filter, so the chart elements that belong to the other two items will vanish
@@ -31,10 +33,24 @@ chart.animate({
3133

3234
Switching the filter off to get back to the original view.
3335

34-
```javascript { "title": "Filter off " }
36+
```javascript { "title": "Filter off" }
3537
chart.animate({
3638
data: {
3739
filter: null,
3840
}
3941
})
4042
```
43+
44+
Here we add another record to the data set and update the chart accordingly.
45+
46+
```javascript { "title": "Adding new records" }
47+
chart.animate({
48+
data: {
49+
records: [
50+
['Soul', 'Hard', 91],
51+
['Soul', 'Smooth', 57],
52+
['Soul', 'Experimental', 115],
53+
]
54+
}
55+
})
56+
```

0 commit comments

Comments
 (0)