Ingo Muschenetz wrote:
> Hi All,
> 
> I'm having a great time enjoying the Timeplot charts. I'd like to
> repurpose it to do an area chart involving three columns of data.

By area chart, do you mean a plot where the different plots are stacked
instead of overlayed?

>I
> thought about doing some sort of custom function to calculate
> percentages but wanted to see if there was a better way.

It's entirely possible to create a DataSource that would generate the
equivalent of stacked charts but without changing the rendering code
(just manipulating the data).

For example, if you have data such as

 a | b | c
-----------
 10  30  20
 ...

you could have a data source that returns you "a" untouched, b* = a + b
and c* = a + b + c and then you would plot overlayed, c* then b* then a.

In this example,

http://simile.mit.edu/timeplot/examples/simile/index.html

you can see that the second plot from the top uses

dataSource: new Timeplot.ColumnDiffSource(eventSource,1,2),

which is defined at the very bottom of

http://simile.mit.edu/repository/timeplot/trunk/src/webapp/api/scripts/sources.js

NOTE: the "Object.extend()" call is Timeplot's version of OOP
inheritance for Javascript 1.x

The only problem with this approach is that the mouse-following labeler
will have the a,b* and c* values, not the original a,b,c ones. To fix
that, I have no solution right now.

Hope this helps.

-- 
Stefano Mazzocchi
Digital Libraries Research Group                 Research Scientist
Massachusetts Institute of Technology
E25-131, 77 Massachusetts Ave               skype: stefanomazzocchi
Cambridge, MA  02139-4307, USA         email: stefanom at mit . edu
-------------------------------------------------------------------

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to