score:4
so, you have the following data structure, right ?
1355417598678,22.25
1355417620144,22.25
1355417625616,22.312
1355417630851,22.375
1355417633906,22.437
1355417637134,22.437
1355417641239,22.5
1355417641775,22.562
1355417662373,22.125
1355417704368,21.625
then you split it into an array of lines, so each array item is a line.
then for each line you do the following.
var items = line.split(';'); // wrong, use ','
but there ins't ;
into the line, you should split using ,
.
the result will be a multidimencional array which each item is an array with the following structure. it will be stored in a var named data
.
"1355417598678","22.25" // date in utc, value
this is the expected data for each serie, so you can pass it directly to your serie
.
var serie = {
data: data,
name: 'serie1' // chose a name
}
the result will be a working chart.
so everything can be resumed to the following.
var lines = data.split('\n');
lines = lines.map(function(line) {
var data = line.split(',');
data[1] = parsefloat(data[1]);
return data;
});
var series = {
data: lines,
name: 'serie1'
};
options.series.push(series);
score:0
you need to put
$(document).ready(function() {
in the 1st line, and
});
in the last line of the javascript to make this work.
score:0
could you upload your csv file? is it identical to what you wrote in your original post? i ran into the same problem, and it turns out there are errors in the data file.
score:1
looking at your line.split part:
$.get('data.csv', function(data) {
// split the lines
var lines = data.split('\n');
$.each(lines, function(lineno, line) {
var items = line.split(';');
it looks like you are trying to split on a semi-colon (;) instead of a comma (,) which is what is in your sample csv data.
Source: stackoverflow.com
Related Query
- Creating a line graph with highcharts and data in an external csv
- Static Highcharts graphic with external csv data and dynamic footnote
- Highcharts to display area range and line chart with data from a CSV file
- Highcharts - Global configuration with common code and unique data & Headings
- How to export CSV and XLS with external button in Highcharts
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- How to stop plotting the graph if data is blank and continue if data is there on the y-axis in base line highcharts
- Highcharts series visibility with csv data source
- Highcharts Highstock How to Plot OHLC and Line Charts from One Set of Embedded CSV Data Using Series Map Tools?
- Static Highcharts graphic with csv data and dynamic footnote
- how to make chart real time with 2 line and get data from php with highcharts
- Highcharts redraw and sort data on draggable line graph
- Plot line is hiding behind trend in highcharts and movement of plotline is become very hindrance when loaded with very large data sets
- Highcharts: Line graph with half solid line and half dotted line?
- Highcharts data series issue with ajax/json and PHP
- Highcharts - Dyanmic graph with no initial data
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Highcharts with JSON data and multiple series
- How to structure Angular with Highcharts and lots of dynamic data
- Add dynamic data to line chart from mysql database with highcharts
- Highcharts v3.0.1 problems with rotating data labels in IE8 and jQuery v1.7.1
- Programmatically draw rect and line in Highcharts with zoom
- Highcharts not displaying series data for graph with multiple Y-axes
- Rails collecting and rendering JSON data in to a Highcharts graph
- Data with timestamp group to month(like Jan, Feb, March) and showing as total count for month in Highcharts
- Highcharts with ajax and json data what am i doing wrong?
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- Highcharts show the same yAxis start and end value with multiple data series
- How can I make a graph with highcharts from csv file?
- Highcharts - reduce the space between zero data line and x-axis
More Query from same tag
- Markers to appear between the ticks
- Highcharts legend hiding wrong data
- Need help in binding dynamic JSON to Highcharts
- Highcharts Pie Chart: How to ignore disabled legend items
- Draw rectangle in the selection, Highcharts
- Highcharts through ajax not drawing
- Highcharts real-time line chart with multiple data streams
- Highcharts random realtime with detecting too high value
- highcharts, gauge chart, update on slider
- HighCharts Export burger menu not showing in AngularJS app
- HighCharts - applying a formatting function over plot options
- Creating a Highchart for every data set
- highcharts minPointLength do not work for unstacked bar chart
- Npm package for Highchart Dumbell Chart
- inner radius polar Highcharter
- Highmaps - how i can have a seperate legend by different report?
- How can I avoid moving flags when mouseovered - highcharts
- Control positioning of background image/pattern
- Add additional data to a Highcharts series for use in formatters
- Is it possible to define an image map area by radial coordinates?
- Highcharts: x-value as date
- same js highcharts display not the same
- Polar Chart in Higcharts 'negativeColor' not showing properly
- Highchart - always show crosshair
- HighCharts PieChart with just one segment doesn't show a label
- Highcharts grouped columns of varying widths that fill the entire space automatically
- Highchart legend symbol
- Uncaught TypeError adding chart in markdown using Jekyll
- Live Graph in HighCharts
- Highcharts with ajax/ json and SQL Server ASP.NET