1

I'm new to highcharts - I am having difficulties getting the highcharts line-ajax demo working (from examples/line-ajax/index.htm)

The demo code includes analytics.tsv', apparently because it is tab delimited. However the index.htm file is looking for 'analytics.csv'. So I changed all that around, but no joy.

I downloaded (from some highcharts demo site) a analytics.csv file, and still no joy.

The highcharts documentation says that 'data' is contained within 'series'. In the demo, it stands just under the jquery selector, with the 'series' specified last in the selector with no 'data' entry.

$('#container').highcharts({
 data: {
   csv: csv
 },
...

At http://www.highcharts.com/demo/line-ajax, it works fine. However if you look at http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/line-ajax/ the demo fails. If you have dev tools enabled on your browser, you'll see it complaining about a missing analytics.csv file

So, my question is simple, what do I need to do to get highcharts own demo working ?

And to clarify, I'm not interested in 'in page' data, I'm specifically interested in loading data into the chart using ajax.

paul1923
  • 81
  • 5
  • Have you seen article about working with data ? http://www.highcharts.com/docs/working-with-data/preprocessing-data-from-a-file-csv-xml-json – Sebastian Bochan Sep 23 '13 at 11:33
  • Documentation linked by Sebastian is now at https://www.highcharts.com/docs/working-with-data/custom-preprocessing – Madis Mar 02 '18 at 10:14

3 Answers3

0

If you look at the ajax URL it's '/samples/highcharts/demo/line-ajax/analytics.csv'. This is a relative path on highchart's server, so, the jsfiddle can not find the file. Now, the full path to the file is http://www.highcharts.com/samples/highcharts/demo/line-ajax/analytics.csv but if you give that to jsFiddle you'll get errors because of the Access-Control-Allow-Origin policy.

If you are working on this on your own server, just download the CSV file and place it someplace available in document root.

Mark
  • 106,305
  • 20
  • 172
  • 230
0

Instead of series[0].data, on that example they use data module https://www.highcharts.com/docs/working-with-data/data-module which is meant importing from CSV, html tables, google spreadsheets.

Madis
  • 411
  • 5
  • 7
-1

I used highcharts in this way:

data:[7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6].

well,you can use the data with " json "

Tamil Selvan C
  • 19,913
  • 12
  • 49
  • 70