Sign in 
 
Charts

Posted by calcsproject on Dec 19, 2008

Description: Charts basic functionality

One of the most important functionality for all scientific application is Charts. And, of course, we support it.

Functions

Currently we support two functions: chart and plot.

Create chart from existing array

chart(array, attributes);

Create chart using function


plot(func, range, attributes);

Attributes

You may use attributes parameter to define some chart parameters like size, type, etc.

attributes parameter should be a dictionary value. For example:


attributes = {'type':'pie', 'labels':['Month','Year']};

Name Description Example
'size' Chart size in pixels '250x300'
'type' Chart type, currently we supports 6 types: line, pie, sparkline, bar, venn and radar. Default chart type is line. 'line' or 'pie'
'labels' Labels for values. Mostly used with pie chart type. ['Month','Year']
'range' Range of values for chart. Default is min and max values for values array [-10,10]

Examples

Simple chart

function f(x)
{
	return 2*x*x+0.5+x+1;
}

vals = [];
for(i=-10; i<10; i++)
{
  vals.push(f(i));
}
chart(vals);

Create sin function chart

plot(Math.sin, [0,10]);

Or use set step value to increase chart points.

plot(Math.sin, [0,10,0.2]);

Comments

Sign in to post comments

Powered by Google App Engine