Dynamic Data + Formatting

Hello all,

I’d like to use the Chart for my program however I need some basic info first: Is it possible to load data dynamically through a database with this? If so, is there a way to format the series? My data is inputted numerically (1, 2, 3, etc) but needs to be displayed as words (Stone, Brick, Rock, etc). Are these possible? Can anyone give an example?

Thanks ^^;

Is it possible to load data dynamically
Do you mean?

chart.clearAll() chart.load(new_data_url);

My data is inputted numerically
Instead of


You can use

var names = ["Stone", "Brick", "Rock"];
label:function(obj){ return names[obj.property]; }

By using function for label - you can implement any complex conversions|formattings

Thank you for the label trick, I will look into it. However, when I say I need to load dynamic data, I mean connect to a database [Oracle] and retrieve data from there.

You can’t load data directly from Db, but you can load from any server side script ( java, php, etc. ) , which will connect to the db, get the data and output it as xml|json|csv

Ook ok good this will work fine as I use php for my front end currently. Is there a tutorial on how to do this anywhere? ^^;

There are separate lib - connectors which can be used, but while it can work with oracle as well, all samples are mysql specific. So it may be a simple solution to use custom php script.

Examples of expected script output can be checked at