Skip to main content

how to add data values in jmaki charting

1 reply [Last post]
vivek_mishra
Offline
Joined: 2007-12-26

hi
i am using jmaki charting but i don't know how to add data in

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31

Hi,

Values can bee added using JavaScript:

In your page you need an event to start the add. Here I will use a Yahoo Button:

value="{ label : 'Add G Dataset'}"
publish="/add"
/>

Basically you can in your glue.js create a handler for an action like a button press or other event that will

var nchart = {id : 'Set 1', label : 'G Series', values : [10, 25, 50, 5, 20, 5, 15, 5, 10, 15, 25, 55] };

// add data set handler
jmaki.subscribe("/add/*", function(args) {
jmaki.publish("/chart/addDataset", nchart);
});

If you look at the Charting sample application you can see this in action by looking at the glue.js for all crud action>

The app is at:
https://jmaki-charting.dev.java.net/servlets/ProjectDocumentList?folderI...

Let me know if this doesn't work.

-Greg