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 on area graph when y axis does not start at 0 #4764

Closed
LORDINGBEATEN opened this issue Oct 15, 2024 · 3 comments
Closed

Animation on area graph when y axis does not start at 0 #4764

LORDINGBEATEN opened this issue Oct 15, 2024 · 3 comments
Labels
feature-request New feature or request

Comments

@LORDINGBEATEN
Copy link

LORDINGBEATEN commented Oct 15, 2024

Description

On an area type chart. If the min and max values ​​on the y axis are high, the animation is ugly.

The animation seems to systematically start from 0 and therefore if the graph only has large values, only the end of the animation is displayed (we almost have a display without animation).

Steps to Reproduce

Example to reproduce the case:

https://codepen.io/LORDINGBEATEN/pen/vYommXX

        var options = {
          series: [{
          name: 'series1',
          data: [242737,242737,242776,242776,242776,242828,242861,242903,242943,243029]
        }],
          chart: {
          height: 350,
          type: 'area',
            animations: {
                enabled: true,
                easing: 'easeout',
                speed: 800,
                animateGradually: {
                    enabled: true,
                    delay: 150
                },
                dynamicAnimation: {
                    enabled: true,
                    speed: 350
                }
            }
        },
        dataLabels: {
          enabled: false
        },
        stroke: {
          curve: 'smooth'
        },
        xaxis: {
          type: 'date',
          categories: ["2024-08-15","2024-08-16","2024-08-17","2024-08-18","2024-08-19","2024-08-20","2024-08-21","2024-08-22","2024-08-23","2024-08-24"]
        },
        tooltip: {
          x: {
            format: 'yyyy-MM-dd'
          },
        },
        };

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

Expected Behavior

Animation should start from min of y axis.

Actual Behavior

The feed seems to start from the value 0 of the y axis.

Screenshots

image

Reproduction Link

<div id="chart">
</div>
#chart {
  max-width: 650px;
  margin: 35px auto;
}
        var options = {
          series: [{
          name: 'series1',
          data: [242737,242737,242776,242776,242776,242828,242861,242903,242943,243029]
        }],
          chart: {
          height: 350,
          type: 'area',
            animations: {
                enabled: true,
                easing: 'easeout',
                speed: 800,
                animateGradually: {
                    enabled: true,
                    delay: 150
                },
                dynamicAnimation: {
                    enabled: true,
                    speed: 350
                }
            }
        },
        dataLabels: {
          enabled: false
        },
        stroke: {
          curve: 'smooth'
        },
        xaxis: {
          type: 'date',
          categories: ["2024-08-15","2024-08-16","2024-08-17","2024-08-18","2024-08-19","2024-08-20","2024-08-21","2024-08-22","2024-08-23","2024-08-24"]
        },
        tooltip: {
          x: {
            format: 'yyyy-MM-dd'
          },
        },
        };

        var chart = new ApexCharts(document.querySelector("#chart"), options);
        chart.render();
@LORDINGBEATEN LORDINGBEATEN added the bug Something isn't working label Oct 15, 2024
@brianlagunas
Copy link
Member

No reproduction link was provided (code snippets don't count). I will reopen when the link has been provided.

@brianlagunas brianlagunas closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
@LORDINGBEATEN
Copy link
Author

Link codepen.io add

https://codepen.io/LORDINGBEATEN/pen/vYommXX

@brianlagunas
Copy link
Member

This is not so much a bug, but rather a request to improve the animations when dealing with large values. Reopening for consideration of a future improvement.

@brianlagunas brianlagunas reopened this Oct 16, 2024
@brianlagunas brianlagunas added feature-request New feature or request and removed bug Something isn't working labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants