• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download
    • Download Chart
    • Download StockChart
  • Integrations
    • Front End Technology Samples
      • React Charts
      • Angular Charts
      • jQuery Charts
      • Dashboards
    • Server Side Technology Samples
      • PHP Charts
      • 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 Zooming and Panning
    • Exporting Chart to Image
    • Chart with Animation
    • Chart with Multiple Axes
    • Chart with Dynamic Data
    • Chart with Logarithmic Axis
    • Chart using JSON Data
    • Performance with 50,000 Data Points
    • Chart with Crosshair
    • Chart inside Re-Sizable Container
    • Charts inside jQuery Tabs
    • Chart inside Popup Modal
    • Responsive jQuery Chart
    • Drilldown Chart
  • LINE CHARTS
    • Line Chart
    • Spline Chart
    • Step Line Chart
  • AREA CHARTS
    • Area Chart
    • Multi Series Area Chart with Date Time
    • Spline Area Chart
    • Multi Series Spline Area
    • 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 Outliers
  • COMBINATION CHARTS
    • Error Chart
    • Error Line Chart
    • Combination of Column, Line and Area Chart
  • DYNAMIC CHARTS
    • Dynamic Line Chart
    • Dynamic Column Chart
    • Dynamic Multi Series Chart
  • STOCKCHARTS
    • StockChart with Numeric Axis
    • StockChart with Date-Time Axis
    • StockChart with SplineArea & Navigator
  • REACT, ANGULAR, JAVASCRIPT
    • React Charts
    • Angular Charts
    • JavaScript Charts
  • SERVER SIDE TECHNOLOGIES
    • ASP.NET MVC Charts
    • PHP Charts
    • JSP Charts
    • Spring MVC Charts

jQuery Candlestick Charts from JSON Data using AJAX

Download jQuery Chart Samples
  • jQuery Chart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • PHP Chart Samples
  • ASP.NET Chart Samples
  • JSP Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples
  • JavaScript StockChart Samples

JSON data can be used as data source for Charts. It is usually good idea to read JSON data from AJAX request for Candlestick Graphs as they are usually rendered with large number of data points. Apart from JSON, Chart can also be plotted from CSV, XML or text file data. However, you need to parse the data to convert it to format accepted by CanvasJS. The given example shows Candlestick Chart rendered from JSON Data. It also contains source code that you can edit in-browser or save to run locally.

Read More >>

Try Editing The Code

window.onload = function() {

var options = {
	animationEnabled: true,
	theme: "light2", // "light1", "light2", "dark1", "dark2"
	exportEnabled: true,
	title: {
		text: "Samsung Electronics Co. Ltd. - November 2017"
	},
	subtitles: [{
		text: "Weekly Averages"
	}],
	axisX: {
		valueFormatString: "DD MMM"
	},
	axisY: {
		prefix: "₩",
		title: "Price",
		valueFormatString: "#0.0,,.M"
	}, 
	legend: {
		dockInsidePlotArea: true
	},
	data: [{
		type: "candlestick",
		showInLegend: true,
		legendText: "Currency in KRW - South Korean Won",
		xValueType: "dateTime",
		yValueFormatString: "₩#,#00.##",
		xValueFormatString: "DD MMM",
		risingColor: "#CBE8C8",
		fallingColor: "#FFCCCC",
		dataPoints: []
	}]
};

$("#chartContainer").CanvasJSChart(options);

$.get("https://canvasjs.com/data/gallery/jquery/samsung-electronics-stock-price.json",function(dps) {
	options.data[0].dataPoints = dps;
	$("#chartContainer").CanvasJSChart().render();
});

}                            

Related Customization

Export feature can be enabled by setting exportEnabled to true. You can also print the chart using print method. Other commonly used customization options are animationEnabled, exportFileName, etc.

Note   For step by step instructions, follow our jQuery Integration Tutorial
© fenopix
  • About Us
  • FAQs
  • Careers
  • Privacy Policy
Server Side Technologies
  • ASP.NET MVC Charts
  • PHP Charts
  • JSP Charts
  • Spring MVC Charts
Front End 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