@@ -28,9 +28,7 @@ const chart = lightningChart({
2828chart . getDefaultAxisX ( ) . setTickStrategy ( AxisTickStrategies . DateTime , ( tickStrategy ) => tickStrategy . setDateOrigin ( dateOrigin ) )
2929
3030// Set chart title and modify the padding of the chart.
31- chart . setTitle ( 'Realtime OHLC and line' ) . setPadding ( {
32- right : 42 ,
33- } )
31+ chart . setTitle ( 'Realtime OHLC and line' )
3432// Modify AutoCursor to only show TickMarker and Gridline over X Axis.
3533chart . setCursor ( ( cursor ) => {
3634 cursor . setTickMarkerYVisible ( false )
@@ -40,7 +38,7 @@ chart.setCursor((cursor) => {
4038// Configure X-axis to be progressive.
4139chart
4240 . getDefaultAxisX ( )
43- . setScrollStrategy ( AxisScrollStrategies . progressive )
41+ . setScrollStrategy ( AxisScrollStrategies . scrolling )
4442 // View fits 5 minutes.
4543 . setDefaultInterval ( ( state ) => ( { end : state . dataMax , start : ( state . dataMax ?? 0 ) - fiveMinutesInMs , stopAxisAfter : false } ) )
4644
@@ -60,10 +58,10 @@ const ohlcSeriesAutoPacking = chart
6058 { seriesConstructor : OHLCSeriesTypes . AutomaticPacking } ,
6159 )
6260 // Set packing resolution to 100 ms so we can zoom to full resolution.
63- . setPackingResolution ( 100 )
61+ // .setPackingResolution(100)
6462
6563const add = ( points ) => {
66- lineSeries . add ( points )
64+ lineSeries . appendJSON ( points )
6765 // With automatic packing, the add method accepts data points that use the {x, y} format (for example, {x: time, y: measurement}).
6866 // OHLC Series can automatically pack these raw measurements into OHLC data.
6967 ohlcSeriesAutoPacking . add ( points )
0 commit comments