jsp
inicio / programacion / {{page.title}}
{% include toc.html %}
propósito
- anotar todo lo relevante sobre jsp
jsp y highcharts
- para poner un gráfico en una página jsp.
- lo saco del foro de highcharts
Example (images.jsp):
<script type="text/javascript">
var chart1;
$(this.document).ready(function() {
var datos = new Array();
<%
System.out.println("Bienvenidos a grafica.jsp");
ArrayList conjunto = (ArrayList) session.getAttribute("carga");
for (int i=0; i<10;i++){
CeldaPlain paso = (CeldaPlain) conjunto.get(i);
String posicion = paso.getPower();
%>
datos['<% out.print(i); %>'] = '<% out.print(posicion); %>';
<%
}
%>
chart1 = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
layout: page
date: 2016-11-05
menuInclude: yes
menuTopTitle: programación
menuSubTitle: "Jekyll"
menuSubIndex: 4
excerpt: "Pequeño resumen del contenido......"
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
layout: page
date: 2016-11-05
menuInclude: yes
menuTopTitle: programación
menuSubTitle: "Jekyll"
menuSubIndex: 4
excerpt: "Pequeño resumen del contenido......"
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: datos
},
{
name: 'John',
data: [5, 7, 3]
}
]
});
});
</script>