1
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
2
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
3
<%@ page language="java" contentType="text/html; charset=UTF-8"
9
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
10
<title>Highcharts export server</title>
11
<link rel="stylesheet" type="text/css" href="resources/css/demo.css" />
12
<link rel="stylesheet" type="text/css"
13
href="resources/lib/codemirror/codemirror.css" />
14
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
15
<script src="resources/lib/codemirror/codemirror.js"></script>
16
<script src="resources/lib/codemirror/mode/javascript/javascript.js"></script>
17
<script src="resources/lib/codemirror/mode/xml/xml.js"></script>
19
$(document).ready(function() {
21
var enableEditor = function(id) {
22
if (id === 'options') {
23
CodeMirror.fromTextArea($('textarea#options')[0], {
27
mode : "text/javascript",
31
// options for svg editor
32
CodeMirror.fromTextArea($('textarea#svg')[0], {
45
// attach eventhandler to radio fields
46
$('input[type="radio"]').change(function() {
47
var checked = this.id, other, html;
48
// which editor is checked/ should be visible
49
checked === 'svg' ? other = 'options' : other = 'svg';
50
// get html source from the div outside of the form
51
$('div#' + checked).html($('div#toggle').html());
52
/* move the html of the previous editor outside the form,
53
remove first Codemirror wrapper */
54
$('div#' + other + ' div.CodeMirror-wrap').remove();
56
$('div#toggle').html($('div#' + other).html());
57
// empty the container which held the previous editor.
58
$('div#' + other).html('');
59
// enable codemirror for texarea
60
enableEditor(checked);
64
// default radio #config is selected
65
$('input#options').prop('checked', true);
67
enableEditor('options');
69
// syntax coloring, indent from codemirror
71
CodeMirror.fromTextArea($('textarea#callback')[0], {
76
mode : "text/javascript",
85
<a href="http://www.highcharts.com" title="Highcharts Home Page"
86
id="logo"><img alt="Highcharts Home Page"
87
src="resources/Highcharts-icon-160px.png" border="0"></a>
88
<h1>Highcharts Export Server</h1>
91
<form id="exportForm" action="./" method="POST">
92
<p>Use this page to experiment with the different options.</p>
94
<input id="options" title="Highcharts config object" type="radio"
95
name="content" value="options"> <label for="options"
96
class="radio">Highcharts config object (JSON)</label> <input
97
id="svg" title="svg xml content" type="radio" name="content"
98
value="svg"> <label for="svg" class="radio">SVG
102
<label id="options" for="options">Options</label>
103
<div id="oneline" class="info">Specify here your Highcharts
104
configuration object.</div>
105
<textarea id="options" name="options" rows="12" cols="30"><%@include
106
file="/WEB-INF/jspf/config.js"%></textarea>
109
<label for="type">Image file format</label> <select name="type">
110
<option value="image/png">image/png</option>
111
<option value="image/jpeg">image/jpeg</option>
112
<option value="image/svg+xml">image/svg+xml</option>
113
<option value="application/pdf">application/pdf</option>
114
</select> <br /> <label for="width">Width</label>
115
<div class="info">The exact pixelwidth of the exported image.
116
Defaults to chart.width or 600px. Maximum width is set to 2000px</div>
117
<input id="width" name="width" type="text" value="" /> <br/> <label
118
for="scales">Scale</label> <input id="scale" name="scale"
119
type="text" value="" />
120
<div class="info">Give in a scaling factor for a higher image
121
resolution. Maximum scaling is set to 4x. Remember that the width parameter has a higher
122
precedence over scaling.</div>
123
<br /> <label for="constructor">Constructor</label>
125
This will be either 'Chart' or 'StockChart' depending on if <br />you
126
want a Highcharts or an HighStock chart.
128
<select name="constr">
129
<option value="Chart">Chart</option>
130
<option value="StockChart">StockChart</option>
131
</select> </br> <br /> <label for="callback">Callback</label>
132
<div id="oneline" class="info">The callback will be fired after
133
the chart is created.</div>
134
<textarea id="callback" name="callback" rows="12" cols="30" /><%@include
135
file="/WEB-INF/jspf/callback.js"%>
137
<input id="submit" type="submit" value="Generate Image">
141
<label id="svg" for="svg">Svg Content</label>
142
<div id="oneline" class="info">Paste in 'raw' svg markup.</div>
143
<textarea id="svg" name="svg" rows="12" cols="30"><%@include
144
file="/WEB-INF/jspf/lexl.svg"%>