esnet / esnet/react-timeseries-charts
Band Charts does not support TimeRangeEvent series
- Dominant language
- JavaScript
- Stars
- 876
- Forks
- 279
- PR merge metrics
- No merged PRs in 30d
Description
# 🐛Bug report
**Describe the bug**
The documentation states that BandCharts do support Indexed and TimeRange events in first scenario (when bands are passed within a series) and with Time events in second scenario (where bands are computed). But TimeRange events just don't work.
**To Reproduce**
1. Create a series containing TimeRangeEvents
2. Observe bands are not being drawn.
**Expected behavior**
Bands are drawn properly.
**Desktop (please complete the following information):**
- OS: Ubuntu 18.04
- Browser: Chromium
- Version 78.0.3904.70
**Additional context**
I fixed the issue by modifying `getSeries` function in `BandChart.js` with following code:
```js
var ee = null;
if (series._collection._type === _pondjs.TimeEvent) {
ee = new _pondjs.IndexedEvent(e.index(), d);
} else if (series._collection._type === _pondjs.TimeRangeEvent) {
ee = new _pondjs.TimeRangeEvent(new _pondjs.TimeRange(e.begin(), e.end()), d);
}
return ee;
```
But I'm not a frontend dev so not sure if made it right way and I won't open the PR.
Contributor guide
Assessment
This issue has not been assessed yet.