esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
859 stars 283 forks source link

Band Charts does not support TimeRangeEvent series #422

Open tenzo opened 4 years ago

tenzo commented 4 years ago

🐛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):

Additional context I fixed the issue by modifying getSeries function in BandChart.js with following code:

        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.