Home forums Using CanvasJS Chart is not displaying Reply To: Chart is not displaying

#21322

Priyanka M S
Member

@kirti,

For security reasons, browsers restrict cross-origin requests. JSONP allows you to sidestep the cross-origin requests. To access JSON from different domain, you can refer to JSONP. Please take a look at this jsfiddle that creates a line chart from AJAX & JSONP.

In order to load a local JSON file on browser, you need to have a local server running in your system to avoid cross origin requests which most of the browsers doesn’t support. Here is a tutorial on setting up a local server, which might be of help.
Please take a look at this jsfiddle that creates a line chart from external JSON data.

__
Priyanka M S
Team CanvasJS