question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Area chart on dynamicAnimation show line before area color

See original GitHub issue

Hello my friend. Firstly, congrats for your plugin, thats awesome.

The problem: When i try to make a realtime Area chart, i get a behavior interesting. This is my code:

var lastDate = 0;
        var data = [];
        var data2 = [];
        function getDayWiseTimeSeries(baseval, count, yrange) {
            var i = 0;
            while (i < count) {
                var x = baseval;
                var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
                var y2 = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;

                data.push({
                    x, y
                });
                data2.push({
                    x, y: y2
                });
                lastDate = baseval
                baseval += 86400000;
                i++;
            }
        }

        getDayWiseTimeSeries(new Date('11 Feb 2017 GMT').getTime(), 20, {
            min: 10,
            max: 90
        })

        function getNewSeries(baseval, yrange) {
            var newDate = baseval + 86400000;
            lastDate = newDate
            data.push({
                x: newDate,
                y: Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min
            })
            data2.push({
                x: newDate,
                y: Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min
            })
        }

        var options = {
            chart: {
                height: 350,
                type: 'area',
                animations: {
                    enabled: true,
                    easing: 'linear',
                    speed: 800,
                    animateGradually: {
                        enabled: true,
                        delay: 100
                    },
                    dynamicAnimation: {
                        enabled: true,
                        speed: 150
                    }
                }
            },
            dataLabels: {
                enabled: false
            },
            series: [{
                name: 'RX',
                data: data
            }, {
                name: 'TX',
                data: data2
            }],
            xaxis: {
                type: 'datetime',
                range: 977600000,
            },
            yaxis: {
                max: 200
            },
            stroke: {
                curve: 'smooth'
            },
            tooltip: {
                x: {
                    format: 'dd/MM/yy HH:mm'
                },
            }
        }

        var chart3 = new ApexCharts(
            document.querySelector("#chart3"),
            options
        );

        chart3.render();

        window.setInterval(function () {
            getNewSeries(lastDate, {
                min: 10,
                max: 90
            })

            chart3.updateSeries([{
                data: data
            }, {
                data: data2
            }])
        }, 2000)

Explanation

  • What is happening instead? The line of area is going to next point before the area color.

  • What is the behavior you expect? Both, line and Area color go together to next point.

  • What error message are you getting? None.

  • An the last one Am i using correctly your plugin?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
junedchhipacommented, Mar 27, 2019

Sure, a pull request is always welcome.

0reactions
marciosalinodiascommented, Mar 27, 2019

Alright my friend, im so glad for your quickly answer.

I will try to talk with them (SVG.js team) to find a way, and if exists, i come back. If they have the solution can i try to make this feature and make a pull request?

Just to help everyone

Thanks for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide to Area Charts | Tutorial by Chartio
Area charts combine the line chart and bar chart for more specific purposes. Use this guide to learn the best times and ways...
Read more >
Series customization in Flutter Cartesian Charts widget
Series customization in Flutter Cartesian Charts (SfCartesianChart) · Animation · Transpose the series · Color palette · Color mapping for data points ·...
Read more >
Area Chart Change the Default Colors - java - Stack Overflow
Every chart has a Fill-Color and the Line-Color. How can i change this 2 things? I checked the CSS in the Scene Builder...
Read more >
animations - ApexCharts.js
Animate the chart when data is changed and chart is re-rendered. speed: Number. Speed at which dynamic animation runs whenever data changes.
Read more >
Excel area chart with positive / negative colors - YouTube
Ever wanted to make an area chart with up down colors, something like this? Then this tip is for you. You can use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found