Computer Science Experimentation
Sunday, February 12, 2012
Web charts and F# services
Celso Axelrud (interpoaaustin@hotmail.com)
2/11/2012
INTRODUCTION
The following solution shows how to create web pages containing charts.
The charts are created using dygraphs JavaScript Visualization Library.
dygraphs is an open source JavaScript library that produces interactive, zoomable charts of time series. It is designed to display dense data sets and enable users to explore and interpret them (http://dygraphs.com/index.html ).
An F# script is used to define programmatically a self-hosted server using WCF-REST.
The service generates sequences of random data.
EXAMPLE
This simple example includes a HTML5 page. A button is used to calls a web service that generates time-series data. The data is displayed it on a chart.
An F# script is used to define programmatically a self-hosted server using WCF-REST.
The service has the signature http://localhost:8000/charts/Get(X1,X2)
where X1 is the number of rows and X2 is the number of sequences generated.
Starting from the current time-stamp, the service adds one day for every row. Random data is generated for the data series.
Even though the example is quite simple, it is quite generic because it includes all the important parts.
The client uses HTML5, javascript and jquery. The communication uses AJAX technology.
Check the full article and code at
https://skydrive.live.com/?cid=BDC87EF39B001785&id=BDC87EF39B001785%21306#!/view.aspx?cid=BDC87EF39B001785&resid=BDC87EF39B001785%21328
Subscribe to:
Posts (Atom)