DataGraph Forums › Technical Support › Support Desk › Animated Y-bar graph
I have made an animated Y-bar graph showing number of dogs born by country from 1940 till now. DataGraph correctly animates the graph so that the top (biggest total) country shows on top, 2nd below etc. and is updated each year as per the animated “year” value. However, the animation is not smooth, it simply presents year X, then year X+1 etc. meaning that all bars update immediately to the new position. Instead, I like to have a transition phase showing the bars moving, similarly to what is done here: https://gyazo.com/413434116ba9c97174166e8a1188de90 . In my current solution, bar positions are based on a rank value computed in a spreadsheet. I guess I could compute a bunch of “in between” rank values so that it appears animated but this seems just too much work. Is there a function in DataGraph to facilitate this smooth animation?
I assume you start from one number column for the year and one number column for each country.
I suggest you create a densified timescale (i.e. something like 10 values per year), then you use the “Plot Action” command from the “Other” drop-down menu to interpolate the Year (x) and Country (y) values in way of the sales time column.
Anyway, you will have to repeat the interpolate action for each country.
Then you can sort data from within DG using the “.isort” column property.
I hope it helps…
Hello,
Just to amend a confusion in my email above; replace:
Then you can sort data from within DG using the “.isort” column property.
by:
Then you can sort data from within DG using the “.sortwith” column property.
you can download a sample file from the link below
Thanks! Much appreciate the file you shared.
Hi,
Thanks for your acknowledgement. I discovered since that you do not even have to use the “.sortwith” property as each line is plotted on the vertical axis to its value position and is therefore sorted. So you can plot directly the unsorted columns. I hope you could get through.
I was able to built my graph file – your test/example file was very helpful and I learned a lot from it. I have 24 countries to display data for so a lot of repetitive values, columns etc. and took a while to get it all done. However, in the end the result is not too useful; there is quite some strong differences between the countries and a lot of the bars get pushed to the bottom making them invisible. Messing around with log scales and alternative computed ranking to overcome this problem does make it better but in the end still not useable. Bummer, I had hoped DataGraph could do this. So I’ll process this in python (using the pandas_alive module).
Thanks again for your test file, even though it didn’t work out for me I still gain valuable insights from it.
DataGraph Forums › Technical Support › Support Desk › Animated Y-bar graph