devexperts / dxcharts-lite

Flexible financial charts based on HTML5 canvas
https://devexperts.com/dxcharts/
Mozilla Public License 2.0
45 stars 9 forks source link

Last price color does not change immediately after `setChartType` #146

Open kokovtsev opened 6 months ago

kokovtsev commented 6 months ago

Duplicates

Latest version

Describe the bug 😯

Precondition: Colors for chart type = line are different from standard ones, e.g. like this

DXChart.createChart(container, {
      colors: {
        lineTheme: {
          upColor: '#ccc',
          downColor: '#ccc',
          noneColor: '#ccc'
        }
      }
    });

When the chart.setChartType method is called, the last price indicator color does not change until some event triggers repaint (e.g. user interacts with the chart, or new data arrives)

Link to minimal reproduction

https://codepen.io/dmkokovtsev/pen/qBvMzXM

Steps to Reproduce the Bug or Issue 🕹

In the codepen attached, press the "Toggle" button to see the issue

Expected behavior 🤔

The "last price" indicator should change its color immediately

Platform

Chrome/Win10

Additional context 🔦

No response