if somebody is interested here is an extension which enables to add Flot ( (javascript plotting library) graphs on a page. Developed for and tested on Lyons version.
First you need to download flot library files (http://code.google.com/p/flot/) : jquery.flot.pack.js and excanvas.pack.js and put them on server path - ( /skins/common/jquery/).
Then activate script extension. Parameters for flot.graph function are almost same as for Flot plot js function - so see its documentation for details.
| Author | Ivan Zderadicka |
| Type | Script |
| Categories | Graphs |
| Requires | MindTouch Core 1.8.3 or later |
| Status | Stable |
| License | Free/Open Source |
| Manifest | http://developer.mindtouch.com/@api/deki/files/4602/=flot.xml |
Install Script
Table of Contents
See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.
DekiScript:
//Prepare some sample data
var serie1=[];
var serie2=[];
var samples=1000;
foreach (var na in list.new(samples)) {
var x= (__count * 4 * 3.14)/samples;
// Item of a serie could be either a tuple [x,y]
let serie1 ..= [[x, num.abs(num.sin(x))]];
// or item could be any map, then we must specify later name of x and y element
let serie2 ..= [{x_field:x, y_field: num.abs(num.round(num.sin(x)))}];
}
//Create graph
flot.graph( [{data:serie1, color:'blue', label:'Analog'},
{data:serie2, color: 'green', x: 'x_field', y:'y_field', label:'Digital'}],
{grid: {tickColor:'#ccccff'}, legend: {position:'ne', containerWidth:120}}, 800, 400);
will create a chart like this:

And this code:
var data=[[0,10], [1, 5], [2, 8], [3,19], [4, 12], [5, 7], [6, 10], [7, 11], [8, 4], [9, 16]];
flot.graph([data], {bars:{show:true}, colors:['red']});
will create this small bar chart:

| File | Version | Size | Modified | |
|---|---|---|---|---|
| ||||
| ||||
| ||||
Copyright © 2011 MindTouch, Inc. Powered by
Could you try to put <eval:js value="3.14"/> on some test page on your wiki with German locals?
If the output is 3,14 - eg with local decimal point, then I guess it's a bug of the eval:js function - because js number literals should be in US notation. Then I propose to file a bug report on this.
If this is the cause of problem then temporary solution would be to use different way to serialize to JSON - try Json.Emit :
<eval:expr value="json.emit(3.14)"></eval:expr>
If this has same problem then the solution is to build something own for JSON serialization or patch the code.