0

I'm trying to use highcharts to display data from a CSV file and using the jQuery $.get(...) function to extract data from it.

.get('test.csv', function(csv) {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        data: {
            csv: csv
        },
            title: {
        text: 'Fruit Consumption'
            },
        yAxis: {
            title: {
                text: 'Units'
            }
        }
    });
}); 

That's example code that I can't get to work on my website because apparently my 'test.csv' file is only local and can't be accessed by the jQuery method.

I feel like I'm misunderstanding a really important but basic thing here so any help would be appreciated!

zrb11002
  • 3
  • 2
  • maybe use something like this https://github.com/evanplaice/jquery-csv/ – im_benton Apr 26 '16 at 02:08
  • _"because apparently my 'test.csv' file is only local and can't be accessed by the jQuery method"_ See http://stackoverflow.com/questions/32996001/jquery-load-only-working-in-firefox/ – guest271314 Apr 26 '16 at 02:26
  • I still can't figure out how to access a file thats in the same folder as the html file. The $.get() method seems to not run at all – zrb11002 Apr 26 '16 at 02:47
  • _"The $.get() method seems to not run at all"_ Are any errors logged at `console`? – guest271314 Apr 26 '16 at 03:10
  • 1
    I've figured it out. Needed to use app.use(express.static("folder directory)) in my app.js file. That makes any files in that folder accessible on the webserver. – zrb11002 Apr 26 '16 at 04:19

0 Answers0