From cc8f3d0e11cd6ec1fa3976f2170a212769a1cc19 Mon Sep 17 00:00:00 2001 From: Mark Silverwood <3482679+SlicedSilver@users.noreply.github.com> Date: Wed, 1 May 2024 15:39:16 +0100 Subject: [PATCH] Allow primitives to draw above the last price animation --- .../src/plugins/user-price-alerts/example/example.ts | 3 ++- src/model/series.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin-examples/src/plugins/user-price-alerts/example/example.ts b/plugin-examples/src/plugins/user-price-alerts/example/example.ts index 9f0c95a80..ffafc6196 100644 --- a/plugin-examples/src/plugins/user-price-alerts/example/example.ts +++ b/plugin-examples/src/plugins/user-price-alerts/example/example.ts @@ -1,4 +1,4 @@ -import { LineStyle, createChart } from 'lightweight-charts'; +import { LastPriceAnimationMode, LineStyle, createChart } from 'lightweight-charts'; import { generateLineData } from '../../../sample-data'; import { UserAlertInfo } from '../state'; import { UserPriceAlerts } from '../user-price-alerts'; @@ -41,6 +41,7 @@ const areaSeries = chart.addAreaSeries({ topColor: 'rgba(4,153,129, 0.4)', bottomColor: 'rgba(4,153,129, 0)', priceLineVisible: false, + lastPriceAnimation: LastPriceAnimationMode.Continuous, }); const data = generateLineData(); areaSeries.setData(data); diff --git a/src/model/series.ts b/src/model/series.ts index 22a235b1e..20dc13c8b 100644 --- a/src/model/series.ts +++ b/src/model/series.ts @@ -411,7 +411,7 @@ export class Series extends PriceDataSource implements IDe } animationPaneView.invalidateStage(); - res.push(animationPaneView); + res.unshift(animationPaneView); return res; }