apexcharts / Blazor-ApexCharts

A blazor wrapper for ApexCharts.js
https://apexcharts.github.io/Blazor-ApexCharts
MIT License
825 stars 94 forks source link

UpdateSeriesAsync not animating? #345

Closed Jako731 closed 11 months ago

Jako731 commented 11 months ago

Hi,

I have an <ApexChart @ref="chart">....</ApexChart> and whenevery i try to update the chart with chart.UpdateSeriesAsync(), it updates the content for the chart but doesnt display any animations despite have animation set in the options (Initial render animations show).

Is there something im missing?

joadan commented 11 months ago

Hello,

I don't know what could be the issue, have you checked the sample at https://apexcharts.github.io/Blazor-ApexCharts/methods/update-series

Jako731 commented 11 months ago

Yeah, i have and my graph is pretty much the same (apart from an added chart function which ill talk about)

I found something thats linked.

Essentially, I have a function

public async Task UpdateGraph()
{
    await chart.UpdateOptionsAsync(true, true, false);
    await chart.UpdateSeriesAsync();
}

seems that the update options function (for myself) is not only slowing down the app (im running this function for 3 different graphs) - doing update series first before the options update seems to play the animations now but im also getting the error Value cannot be null when running the function update options async - what reason could there be that causes this issue, as far as i can see, nothing that im inputting is null 🤔

Jako731 commented 11 months ago

Turns out somewhere options.Series is null so i just had to put in a check for that