Skip to main content

Unable to get jmaki charts 0.9.3 working with jmaki 1.8.0 beta in strut app

4 replies [Last post]
nunni
Offline
Joined: 2008-05-26
Points: 0

Hi,

I am a newbie trying out jMaki charting in a struts/jsp application. I am able to get the sample charts (jMaki.charting.area and jMaki.charting.line) working in my jsp page when no "value" attribute is specified for the same. But if I add a valid value attribute (even using the sample app's value), it says 'Unable to load widget'. I have tracked down the error to the following:

a.v has no properties
https://localhost:8443/jmaki-strutsExample/resources/jmaki/charting/reso...
Line 32

The widget is used like below and the template data loads if I omit the value attribute as mentioned:

I have ajax-wrapper-comp-1.8.0.jar and org.json-0.0.2.jar along with a lot of struts and other dependent jars in my WEB-INF/lib folder.

Any pointers as to what could be causing this issue and how to resolve it?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hi nunni,

You will see that behavior when the data is not formated correctly. I tried the following and it works. Greg is working on a tool that will validate JSON data to make sure it matches the data model. I will send a pointer to that when it is done. You wil then be able to verify that the data you are using is in the correct format.

value="{
xAxis : {
title : 'Months',
labels : [{ label : 'January'},
{ label : 'February'},
{ label : 'March'},
{ label : 'April'},
{ label : 'May'},
{ label : 'June'},
{ label : 'July'},
{ label : 'August'},
{ label : 'September'},
{ label : 'October'},
{ label : 'November'},
{ label : 'December'}
]
},
yAxis : {
title : 'Temperature',
labels : [{ label : '0', value : 0},
{ label : '10s', value : 10},
{ label : '20s', value : 20},
{ label : '30s', value : 30},
{ label : '40s', value : 40},
{ label : '50s', value : 50}
]
},
data : [
{label : 'Gray Series', values : [25, 45, 25, 45, 50, 25, 35, 25, 25, 20, 35, 45] },
{label : 'Pink Series', values : [20, 40, 30, 35, 45, 20, 25, 15, 20, 25, 30, 40] },
{label : 'Blue Series', values : [15, 35, 15, 40, 30, 15, 20, 10, 15, 20, 30, 35] },
{label : 'Red Series', values : [10, 25, 10, 5, 20, 5, 15, 5, 10, 15, 25, 30] }

]
}"/>

nunni
Offline
Joined: 2008-05-26
Points: 0

Thanks, it would be a great help to get a validator for the json data.
Regards,
N.Unni

carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hi,

I did update the validate tool late last week and I would like to test it more. It handles some of the data models but not all. I will work on the charting models this week.

See jmaki.com/validate.html

carla

clen23
Offline
Joined: 2008-06-02
Points: 0

hey,

why don't you try visifire. it is free & being offered under open source. has cool animation too.