I'd like to do a line-graph on a web-page using Javascript. I want it to be animated so that when the page loads, the line is slowly "drawn" onto the graph.
I've managed to get a static graph working, using flot, however I'm unsure how to animate it.
It would be half my job done to just make it draw a line half-way along the graph, but when I try to do this by modifying the data-set, it modifies the structure of the graph as well, so that the line fills 100% of the graph area.
So is there a way to draw the line data in stages, so I can animate it?
Or alternatively, is there some other javascript graphing framework that I've overlooked?
You may use d3js. Learning d3 will take some time, but it's power ie enormous and unparalleled.
https://www.quora.com/How-do-I-learn-D3-js
http://big-elephants.com/2014-06/unrolling-line-charts-d3js/
A few examples of d3 visualizations:
Official d3 Website
Something I've built for an NGO
I wanted to add horizontal line animations to my flot charts too, unfortunately there is no plugin to do this.
please feel free to use the plugin I created to do that : http://www.codicode.com/art/jquery_flot_animator.aspx
Here's a simple example using Flot
I have written a library that focuses heavily on animation of graphs. Notice the animation during resizes. Hope this helps you and everyone else!
LYNE.JS
GIF SAMPLE
LIVE SAMPLES
I have put across a series of Graphs and Chart Libraries that would serve your purpose as well as help you create the chart or visualization that you would please. Have a look at this article http://shivganesh.com/2015/05/infovizgeek-encyclopedia-for-visualization-tools/
Thinking outside the box (since the box that is flot is unfamiliar to me), you could just cover the graph with a div which slow recedes and displays the line. Shrinking a div in javascript is a trivial task even without third party libraries.
Edit:
I had to see how easy it was, so I threw this together in about 10 mins.