0

I want to create a line chart with some data from a json file, I'm working with Highcharts for that.

In the url for the json file I find something like that : https://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?

I downloaded the json file and then I put it locally, when I give in the url the local json I dont see the chart.

How can I solve that ?

this is the full example in jsfiddle :

jsFiddle

Sohrab Hejazi
  • 1,441
  • 6
  • 18
  • 29
Lamya Lam
  • 33
  • 1
  • 7
  • Please open the console and include a screenshot, also check [this](http://stackoverflow.com/questions/371875/local-file-access-with-javascript) question, I'm about 99% that this is the problem – roperzh Nov 12 '15 at 01:58

2 Answers2

1

The data is in the format of .php you need to parse that into actual JSON by using json_encode or use $.ajax instead of $.getJSON along-with CORS and Using Apache as an internal server.

Airwind711
  • 120
  • 3
0

You need to have a webserver, because browsers block run files from local file system, due to security reasons.

Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75