Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

animation: The charts (line) isn't showing the animation after I update the series #88

Open
FabianMontoya opened this issue Nov 14, 2023 · 0 comments

Comments

@FabianMontoya
Copy link

First I created a chart with empty series and xaxis categories, after a request I update the series and categories:

EX:

chartOptions.value = {
      ...chartOptions.value,
      xaxis: {
        ...chartOptions.value.xaxis,
        categories: ['Initial', 'Month 1', 'Month 2', 'Month 3', 'Month 4', 'Month 5']
      }
    };
 chartData.value[0].data = [80, 70, 65, 60, 55, 50];

And the data only appear, doesn't showing any animation (like when the chart is created as new).

For now, I solved it adding a v-if into the apexchart component:

<apexchart v-if="showChart" type="line" height="100%" :options="chartOptions" :series="chartData" />

And I init it in false, and after I update the values, change it to true:

chartOptions.value = {
    ...chartOptions.value,
    xaxis: {
      ...chartOptions.value.xaxis,
      categories: ['Initial', 'Month 1', 'Month 2', 'Month 3', 'Month 4', 'Month 5']
    }
  };
  chartData.value[0].data = [80, 70, 65, 60, 55, 50];

  setTimeout(() => {
    showChart.value = true;
  }, 0);

I don't know if it's an error or if I'm doing something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant