Skip to content

Commit 1e84ee5

Browse files
authored
fix CandlestickSeries constructor (#8664)
- likely a copy-pasta error from Series, where index=0 is passed to BaseSeries constructor, only now it was passed as SeriesType, which is subsequently set in CandlestickSeries constructor
1 parent 2cafba8 commit 1e84ee5

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Common/CandlestickSeries.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ public CandlestickSeries(string name, int index, string unit)
7272
/// <param name="name">Name of the chart series</param>
7373
/// <param name="unit">Unit of the series</param>
7474
public CandlestickSeries(string name, string unit)
75-
: base(name, 0, unit)
75+
: base(name, SeriesType.Candle, unit)
7676
{
77-
SeriesType = SeriesType.Candle;
7877
}
7978

8079
/// <summary>

Common/SeriesSampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private CandlestickSeries SampleCandlestickSeries(CandlestickSeries series, Date
239239
var startIndex = candlesticks.FindIndex(x => x.Time > nextSampleTime) - 1;
240240
if (startIndex < 0)
241241
{
242-
// there's not value before the start, just return identity
242+
// there's no value before the start, just return identity
243243
return GetIdentitySeries(sampledSeries, series, start, stop, truncateValues);
244244
}
245245
if (candlesticks[startIndex].Time == nextSampleTime && nextSampleTime <= stop)

Common/Util/SeriesJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
9999

100100
default:
101101
writer.WritePropertyName("values");
102-
serializer.Serialize(writer, (value as BaseSeries).Values);
102+
serializer.Serialize(writer, baseSeries.Values);
103103
break;
104104
}
105105

0 commit comments

Comments
 (0)