• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download/NPM
    • Download CanvasJS
    • Install via NPM
  • Integrations
    Front End Technology Samples
    • React Charts
    • Angular Charts
    • Vue.js Charts New!
    • jQuery Charts
    • Dashboards
    Server Side Technology Samples
    • PHP Charts
    • Python Charts New!
    • ASP.NET MVC Charts
    • Spring MVC Charts
    • JSP Charts
  • License
  • Blog
  • Docs
    • Chart Documentation
    • StockChart Documentation
  • Support Forum
    • Chart Support
    • StockChart Support
  • My Account
My Account
  • KEY FEATURES
    • Chart with Index / Data Label
    • Chart with Zooming / Panning
    • Chart using JSON Data
    • Chart with Animation
    • Multi Series Chart
    • Chart with Multiple Axes
    • Chart with Crosshair
    • Chart with Scale Breaks
    • Chart with Logarithmic Axis
    • Performance with 50,000 Data Points
    • Responsive Charts
    • Chart with Drilldown
  • LINE CHARTS
    • Line Chart
    • Spline Chart
    • Step Line Chart
  • AREA CHARTS
    • Area Chart
    • Multi Series Area Chart with Date Time Axis
    • Spline Area Chart
    • Step Area Chart
    • Range Area Chart
    • Range Spline Area Chart
    • Stacked Area Chart
    • Stacked Area 100% Chart
  • COLUMN & BAR CHARTS
    • Column Chart
    • Bar Chart
    • Range Column Chart
    • Stacked Column Chart
    • Stacked Column 100% Chart
    • Range Bar Chart
    • Stacked Bar Chart
    • Stacked Bar 100% Chart
    • Waterfall Chart
  • PIE & FUNNEL CHARTS
    • Pie Chart
    • Pie Chart with Index Labels Placed Inside
    • Doughnut Chart
    • Funnel Chart
    • Funnel Chart with Custom Neck
    • Pyramid Chart
  • FINANCIAL CHARTS
    • Candlestick Chart
    • Candlestick Chart from JSON
    • OHLC Chart
  • SCATTER & BUBBLE CHARTS
    • Scatter Chart
    • Scatter Chart with Custom Markers
    • Bubble Chart
  • BOX & WHISKER CHARTS
    • Box and Whisker Chart
    • Box and Whisker Chart with Customization
  • COMBINATION CHARTS
    • Error chart
    • Error Line Chart
    • Pareto Chart
    • Combination of Column, Line and Area Chart
  • DYNAMIC CHARTS
    • Dynamic Line Chart
    • Dynamic Column Chart
    • Dynamic Multi Series Chart
  • DATA BINDING
    • Chart from CSV
    • Chart from XML
    • Chart Data from Database
  • REACT, ANGULAR, VUE.JS, JQUERY
    • React Charts
    • Angular Charts
    • Vue.js Charts
    • jQuery Charts
    • JavaScript Charts
  • SERVER SIDE TECHNOLOGIES
    • Spring MVC Charts
    • ASP.NET MVC Charts
    • PHP Charts
    • Python Charts

JSP OHLC Charts & Graphs

Download JSP Chart Samples
  • JSP Chart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • Vue.js Chart Samples
  • jQuery Chart Samples
  • PHP Chart Samples
  • Python Django Chart Samples
  • ASP.NET Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples
  • JavaScript StockChart Samples
  • JSP Code
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.google.gson.Gson"%>
<%@ page import="com.google.gson.JsonObject"%>

<%
Gson gsonObj = new Gson();
Map<Object,Object> map = null;
List<Map<Object,Object>> list = new ArrayList<Map<Object,Object>>();

map = new HashMap<Object,Object>(); map.put("x", 1512066600000L); map.put("y", new Double[] {1216.15, 1235.00, 1208.00, 1211.65}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512325800000L); map.put("y", new Double[] {1217.00, 1225.09, 1201.80, 1217.50}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512412200000L); map.put("y", new Double[] {1214.50, 1214.50, 1191.34, 1209.90}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512498600000L); map.put("y", new Double[] {1205.90, 1212.00, 1189.00, 1191.25}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512585000000L); map.put("y", new Double[] {1196.00, 1228.44, 1196.00, 1218.40}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512671400000L); map.put("y", new Double[] {1225.00, 1227.00, 1217.69, 1220.34}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1512930600000L); map.put("y", new Double[] {1224.00, 1229.00, 1215.25, 1221.84}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513017000000L); map.put("y", new Double[] {1221.19, 1221.50, 1200.50, 1202.90}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513103400000L); map.put("y", new Double[] {1204.50, 1210.00, 1185.00, 1189.25}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513189800000L); map.put("y", new Double[] {1196.50, 1200.00, 1176.09, 1188.80}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513276200000L); map.put("y", new Double[] {1202.00, 1216.25, 1201.00, 1203.55}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513535400000L); map.put("y", new Double[] {1195.00, 1224.00, 1175.00, 1217.90}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513621800000L); map.put("y", new Double[] {1222.00, 1222.00, 1213.34, 1219.90}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513708200000L); map.put("y", new Double[] {1217.19, 1240.44, 1209.00, 1232.50}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513794600000L); map.put("y", new Double[] {1239.00, 1265.00, 1237.00, 1258.80}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1513881000000L); map.put("y", new Double[] {1260.40, 1270.00, 1253.00, 1266.15}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1514226600000L); map.put("y", new Double[] {1266.15, 1275.00, 1257.30, 1269.69}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1514313000000L); map.put("y", new Double[] {1268.90, 1275.94, 1251.30, 1257.84}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1514399400000L); map.put("y", new Double[] {1257.50, 1264.94, 1249.44, 1252.75}); list.add(map);
map = new HashMap<Object,Object>(); map.put("x", 1514485800000L); map.put("y", new Double[] {1262.00, 1270.00, 1247.94, 1258.25}); list.add(map);

String dataPoints = gsonObj.toJson(list);
%>

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
window.onload = function() { 

var chart = new CanvasJS.Chart("chartContainer", {
	animationEnabled: true,
	exportEnabled: true,
	theme: "light2",
	title: {
		text: "Larsen & Toubro Limited Stock Price"
	},
	subtitles: [{
		text: "December 2017"
	}],
	axisX: {
		valueFormatString: "D MMM"
	},
	axisY: {
		title: "Price (in INR)",
		prefix: "₹"
	},
	data: [{
		type: "ohlc",
		xValueFormatString: "D MMM",
		yValueFormatString: "₹#,##0.00",
		dataPoints: <%out.print(dataPoints);%>
	}]
});
chart.render();

}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
</body>
</html>                              

Quick Links

  • Chart Docs
  • StockChart Docs
  • About Us
  • FAQs

Server Side Technologies

  • ASP.NET MVC Charts
  • PHP Charts
  • JSP Charts
  • Spring MVC Charts

Front Side Technologies

  • JavaScript Charts
  • jQuery Charts
  • React Charts
  • Angular Charts
  • JavaScript StockCharts

Contact

  • Fenopix, Inc.
  • 2093 Philadelphia Pike,
  • #5678, Claymont,
  • Delaware 19703
  • United States Of America

©2025 Fenopix Privacy Policy Cookies Policy Careers