Hi,
Usually the best approach to this is to calculate your graph points as data accumulates and to then store that into a Stream and plot your graph from that stream.
Other wise the info table functions and javascript can certainly help you calculate the points you need from a raw data set but it will be much more process intensive and therefor slower to render. so a 'running' aggregate calculation that is stored as data accumulates would work better.
Not sure if that is possible in your use case though.
It would be very tedious in my case as I have got lot of data (graph lines) to display.Don't we have any aggregate flag sort of thing in ThingWorx composer itself to make it turn Off or On.?