Skip to content

Memory leak when using realtime charts #605

@mcrapts

Description

@mcrapts

Codepen

The bug in question is illustrated by the realtime demo on the website: https://apexcharts.com/javascript-chart-demos/line-charts/realtime/

Explanation

Expected behaviour:
Be able to remove non-visible data points (avoiding memory leaks) while retaining the realtime animation

What is happening:
Two twings can happen:

  1. Do nothing and the series array containing the datapoints will keep expanding forever (memory leak). The animation looks as expected, but after a few minutes the browser will start struggling due to the memory leak.
  2. Remove non-visible data points from the series. This avoids the memory leak, but the realtime animation is not there anymore and instead you get weird animations when data points move in a vertical manner. The demo on the website solves this by "resetting" the data series every 60 seconds, but this causes the chart to show glitchy behaviour every 60 seconds.

I hope it is possible to fix this. In its current form the realtime chart is unfortunately not usable for anything other than demo purposes. That's a shame because ApexCharts is a really nice looking promising charting library and the realtime chart could be a killer feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions