mariusmuntean/ChartJs.Blazor

Call SetupCompletedCallback.InvokeAsync on Update()

vouksh opened this issue · 0 comments

Describe the feature request

I'm using a gradient color scheme on a chart, and discovered that if I update the chart data, everything turns into the base color and the gradient disappears. After some tinkering, I found that if I made a ref to the chart, I can do
await _timelineChart.SetupCompletedCallback.InvokeAsync(_timelineChart);
And the chart will then re-apply the styling from the javascript. Manually invoking the SetupCompletedCallback method did not achieve anything.

Which charts does this feature request apply to?

All charts

Describe the solution you'd like

When running await chart.Update(), SetupCompletedCallback is re-invoked.

JavaScript equivalent

(Sorry, not well-versed enough in JS to fill this section in)

Describe alternatives you've considered

I'm currently running the invoke manually like
SetupTimelineChart();
await _timelineChart.Update();
await _timelineChart.SetupCompletedCallback.InvokeAsync(_timelineChart);

Additional context

Without invoking the SetupCompletedCallback:
image
image
With:
image