score:1
Accepted answer
i got it now...
// data is variable from $.get()
$.get('http://www.geoinc.org/dropbox/geo/sites/gc_room/example.csv', function(data){
// parsing here...
});
new highcharts.chart(options);
});
your problem is the placement of the new highcharts.chart(options)
call. $.get
(like most ajax calls) is asynchronous so the new highcharts
will be called before it completes.
change it to this:
// data is variable from $.get()
$.get('http://www.geoinc.org/dropbox/geo/sites/gc_room/example.csv', function(data){
var lines = data.split('\n');
$.each(lines, function (lineno, line) {
var items = line.split(',');
if(lineno !== 0) {
var x = + new date(items[1]+'/'+items[2]+'/'+items[0]+' '+items[4]),
kwh = parsefloat(items[5]),
savings = parsefloat(items[6]);
if(!isnan(kwh) && !isnan(savings)){
options.series[0].data.push([x,kwh]);
options.series[1].data.push([x,savings])
}
}
});
new highcharts.chart(options); // this is now in the $.get callback function
});
Source: stackoverflow.com
Related Query
- Select which columns from CSV to graph with HighChart
- How do I select which columns from my CSV to chart with HighChart?
- How can I make a graph with highcharts from csv file?
- How to create chart with highchart in which bar doesn't start from 0 in y axis?
- How to show highchart graph depends on select tag from HTML
- Create Highchart graph from specific CSV file
- Creating a line graph with highcharts and data in an external csv
- How to align HTML span at center of highchart donut graph with responsive design?
- Remove Image/Symbol from Highchart Graph
- Waterfall Highchart to start some of the columns in between the series with 0 y-axis
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- How to deal in Highcharts with special characters from CSV file?
- Nested table yields unexpected columns for a basic column graph using high charts with 'Data defined in a HTML table'
- Populating a highchart graph from a linq query
- How do I move the title-label of a polar (spider) graph with HighChart 4?
- Data from MongoDB results with empty Highcharts graph
- How to get image of graph from highchart in web page only?
- Highchart - The expected type comes from property 'dashStyle' which is declared here on type 'XAxisPlotLinesOptions'
- Highchart : How to plot Stacked bar graph with line by below JSON respons
- How to populate a Highchart graph with Angular
- Creating a Highchart with multiple series from a JSON file
- how do i redraw only the Highchart with new API that depends on my Select Option Parameter?
- Highchart with external CSV (in external domain)
- Populate Highchart with data from a python function
- Highchart multiple series with csv
- Javascript charting plugin which allows to select a portion of an area graph
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- How can I create Highcharts Arearange graph from CSV file?
- Highcharts series visibility with csv data source
- Cannot display a legend with special character in highchart from the serie name
More Query from same tag
- Can't detect click function HighCharts plotLines & plotBands.events
- Pulling series data into HighCharts using Javascript
- does Highstock support a right border for a panel (yAxis)?
- highcharts not showing in internet explorer
- Highcharts - issue about full chart width
- Highchart example not working in seperate html page
- Create Highchart from the Following Data
- Inserting mouseover event to custom label created with SVGRenderer, highcharts
- Graphite or multiple query with AJAX call?
- how to change the position of HighCharts.js scatterplot marker position
- Highcharts return undefined value at a lot of data
- Pie chart with two circles need to change background color in inner circle
- Displaying multiple Highcharts from single json
- Highcharts legend custom css style / format using only highcharts options
- Shared tooltip with multiple stacks
- javascript slider like "highstock slider"
- Highcharts yAxis.max manage tick intervals dynamically
- Highchart Pie chat not display Codeigniter
- Firefox && IE TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element
- HighChat Heatmap: Tooltip
- Firebase data not plotting in HighCharts
- Is there a way to color boxplots based on group in hcboxplot()?
- Behavior of multiple HighCharts on single page when removing one div
- How to Format HighChartsJS ToolTip so it Only shows one X-axis?
- Issue on Setting Up Highchats.js Index of Chart
- Disable PDF and SVG download options in Highcharts
- Column width in Highcharts when combined with spline
- Highstock timezone trouble
- Show Series and colorAxis both in Legend
- Display threshold line even if threshold value is higher than max y-axis value in HighStock