When we are not aggregating multiple prices, use the oldest data available as the left hand side of chart, not the requested start.

pull/184/head
Simon Roberts 3 years ago
parent 620e5c737c
commit 2f616e2c35
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -174,9 +174,9 @@ func (ct *Cointop) ChartPoints(symbol string, name string) error {
// Resample cachedata
timeQuantum := timedata.CalculateTimeQuantum(cacheData)
newStart := time.Unix(start, 0).Add(timeQuantum)
newStart := cacheData[0][0] // use the first data point
newEnd := time.Unix(end, 0).Add(-timeQuantum)
timeData := timedata.ResampleTimeSeriesData(cacheData, float64(newStart.UnixMilli()), float64(newEnd.UnixMilli()), chart.GetChartDataSize(maxX))
timeData := timedata.ResampleTimeSeriesData(cacheData, newStart, float64(newEnd.UnixMilli()), chart.GetChartDataSize(maxX))
labels := timedata.BuildTimeSeriesLabels(timeData)
// Extract just the values from the data

Loading…
Cancel
Save