Comments (14)
This commit 1ded7a0 fixes the flickering
from apexcharts.js.
Yes, it doesn't look very pretty.
I will try something else for animation of updated pie/donut charts
from apexcharts.js.
My animations are even weirder. The shape gets close to an '8' somehow then back to normal. I just disabled animation for donut chart while waiting for a fix.
from apexcharts.js.
Right!
I am guessing the '8' might be because of angle getting bigger than 360 when animating.
Will look into it.
from apexcharts.js.
Tried an alternative way to animate pie/donut when data changes.
Still, not 100% perfect, but prevents the weird drawings now.
from apexcharts.js.
One method I imagined would be to have the existing data slices that are to be replaced, roll up clockwise into the 12 o'clock position just like they appeared when the chart was first drawn except in a mirrored fashion. Then have all the new data slices roll roll out of the 12 o'clock position just like they do when it's first drawn that way any additional slices that might need to be created if extending the data series by one of more won't akwardly be just dumped onto the canvas. Same can be said if you are decreasing the data series....once the slices are rolled up into the 12 o'clock position one or more slices can be disposed of without glitching while the remaining needed slices can then extend back out onto the canvas just like on a fresh chart.
from apexcharts.js.
@unknownentity123 Thanks for your input.
I decided not to make it complicated and spent some more time to achieve a natural looking animation.
Finally, after some hours of playing with "startAngle" and "toAngle", I was able to achieve a very smooth transition.
Here is the end result
from apexcharts.js.
Here is the codepen example to play with
from apexcharts.js.
Awesome work here, this is looking perfect.
On the codepen the graph blinks when I click a button, a bit strange.
from apexcharts.js.
Yes, I can see a bit of flickering, couldn't find an easy fix for this yet.
I will keep an eye on it though.
from apexcharts.js.
Awesome...fantastic solution! Love the animation and it looks a lot more natural that what I was suggesting so a win all the way around!
from apexcharts.js.
This morning, I'm working on using the newest release and the animation is perfect...however now any edge between slices that occurs past the 180 degree mark of the pie/donut creates a drop shadow on the previous slice that wasn't present in the previous releases before the fix. The drop shadow may also be present on less that 180 edges but I can't seem to really see it on my examples and might just be due to the angle of the shadow. Before the edges just a flat look and only the whole pie had a 3-D look with the drop shadow.
See my example used on my other post here:
https://codesandbox.io/s/l2porqmrk7
from apexcharts.js.
The drop shadow was always there, but I changed a default setting in fill.opacity
fill: {
opacity: 1 // previously, it was 0.8
}
This change has made the shadow darker. If you want to lighten the shadow, you can reduce the opacity of the shadow.
In your example, try 0.05 instead of 0.1
The reason I did the fill.opacity
change is to not modify the default color settings given by the user as it may cause inconsistencies with their theme colors.
from apexcharts.js.
Gotcha...thanks! It's crazy that 0.2 made that much of a difference in visibility. Although I did remove the stroke between the slices which would break up and hide some of the shadow if left visible and default width.
from apexcharts.js.
Related Issues (20)
- Inconsistent handling of axis labels for different screen sizes
- Scrolling "out of range" data should be enabled - optionally
- Wrong hours on x-axis labels when Daylight Saving Time changes
- Touch support for onMouseMove event Broken HOT 1
- Option yaxis.labels.formatter is not updated when options prop changes HOT 2
- First line value stacked on multiple y axis graph ( bar + line ) HOT 1
- [NPM] No 3.49.0 package
- DOCS - mixed charts > multiple Y-axis sample not showing HOT 2
- Additional notes to csv file
- Markers and axis line
- Combo chart columnWidth:100% appears with large gaps when zoomed in
- Animation wrong when updating series (3.48 worked, 3.49 not working) HOT 2
- yaxis labels duplicated with a formatter function
- Zoom is broken if x-axis range is set HOT 2
- Radar chart x-axis labels get cut off on small screens(mobile) HOT 1
- Firefox bug since 124.0.1 HOT 1
- Support Border Radius for Donut, Pie and Polar Area Charts HOT 1
- Stacked charts are not displayed correctly if there are several series
- Mixed charts (column & line) not working. HOT 2
- Can add icon or help text to explain the charts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apexcharts.js.