-
Sep 22nd, 2011, 04:25 AM
#1
Include jquery.js ,highcharts.js in jspx page
Hello every one
i know it very common thing but i am stuck. i am quite new to spring roo . i am using spring roo 1.0.2 .
i am generating some graphs using highcharts.js http://www.highcharts.com/.
for this purpose i need to include more than two js files in my jspx page .
my files are
jquery.min.js
mootools-yui-compressed.js
mootools-adapter.js
highcharts.js
combineLS.js
i have tried
<spring:url value="/resources/styles/jquery.min.js" var="jquery"/>
<spring:url value="/resources/styles/mootools-yui-compressed.js" var="moot"/>
<spring:url value="/resources/styles/mootools-adapter.js" var="adapter"/>
<spring:url value="/resources/styles/highcharts.js" var="charts"/>
<spring:url value="/resources/styles/combineLS.js" var="combine"/>
<script src="${adapter}" language="JavaScript" type="text/javascript" ></script>
<script src="${charts}" language="JavaScript" type="text/javascript" ></script>
<script src="${combine}" language="JavaScript" type="text/javascript" ></script>
<script src="${jquery}" language="JavaScript" type="text/javascript" ></script>
<script src="${moot}" language="JavaScript" type="text/javascript" ></script>
in my index.jspx page as well as in default.jspx page
but nothing is displayed
my jspx page is
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:security="http://www.springframework.org/security/tags" xmlns:spring="http://www.springframework.org/tags" id="menu_id" version="2.0">
<spring:url value="/resources/styles/jquery.min.js" var="jquery"/>
<spring:url value="/resources/styles/mootools-yui-compressed.js" var="moot"/>
<spring:url value="/resources/styles/mootools-adapter.js" var="adapter"/>
<spring:url value="/resources/styles/highcharts.js" var="charts"/>
<spring:url value="/resources/styles/combineLS.js" var="combine"/>
<script src="${adapter}" language="JavaScript" type="text/javascript" ></script>
<script src="${charts}" language="JavaScript" type="text/javascript" ></script>
<script src="${combine}" language="JavaScript" type="text/javascript" ></script>
<script src="${jquery}" language="JavaScript" type="text/javascript" ></script>
<script src="${moot}" language="JavaScript" type="text/javascript" ></script>
<h1>Hiiiiiiiii</h1>
<div id="container" style="width:300px; height: 200px;"></div>
</div>
my combineLS.js is
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
title: {
text: 'Combination chart'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums']
},
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y +' fruits';
} else {
s = ''+
this.x +': '+ this.y;
}
return s;
}
},
labels: {
items: [{
html: 'Total fruit consumption',
style: {
left: '40px',
top: '8px',
color: 'black'
}
}]
},
series: [{
type: 'column',
name: 'Jane',
data: [3, 2, 1, 3, 4]
}, {
type: 'column',
name: 'John',
data: [3, 2.67, 3, 6.33, 3.33]
}, {
type: 'column',
name: 'Joe',
data: [4, 3, 3, 9, 0]
}, {
type: 'line',
name: 'Average',
data: [3, 2.67, 3, 6.33, 3.33]
}]
});
});
Thanx in advance
-
Sep 22nd, 2011, 05:39 PM
#2
Hi
I have been trying to use the jQuery DataTables library in Spring Roo and have (finally) done this. I detailed what I needed to do in this forum post: http://forum.springsource.org/showth...upport-for-Roo
The only complication I found was getting the styling correct but hopefully (having used HighCharts on other projects) this shouldn't be as difficult.
Hope that helps.
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules