score:1
I see that date
variable in your code is a string:
// all data lines start with a double quote
line = line.split(',');
date = line[1] + " " + line[2];
(...)
RTC.push([
date,
parseInt(line[3], 10)
]);
If you choose to construct the point's options as an array of two values and the first value is a string then it's treated as its name
property (not x
).
Explanation: https://www.highcharts.com/docs/chart-concepts/series
In that case Highcharts assigns subsequent integers as x values for all points (that's why there're values like 00:00:00.000
(1 Jan 1970), 00:00:00.001
etc.).
You need to parse your date to timestamp. You can use Date.UTC()
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC) or some other function for this.
score:0
I've managed to get it working with Date.UTC
using the following code:
var yyyymmdd = line[2].split("-"); //Split the date: 2017 12 16
var hhmmss = line[3].split(":"); //Split the time: 16 11 14
var date = Date.UTC(yyyymmdd[0], yyyymmdd[1] - 1, yyyymmdd[2], hhmmss[0], hhmmss[1], hhmmss[2]); //Stitch 'em together using Date.UTC
Source: stackoverflow.com
Related Query
- Highcharts with external CSV $.get - No xAxis date
- Creating a line graph with highcharts and data in an external csv
- How to export CSV and XLS with external button in Highcharts
- Not able to draw a Pie Chart with external csv file in HighCharts
- Highcharts series visibility with csv data source
- Highcharts (Highstock): Get data from external CSV, doesn't display date correctly
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- Static Highcharts graphic with external csv data and dynamic footnote
- How to get rangeSelector to work with HighCharts
- Populate Highcharts X-Axis With Dates Given a From And To Date
- Highcharts chart with 'datetime' xAxis - use categories on drilldown
- Highcharts missing first date label on xAxis
- Wrong alignment in highcharts datetime points with xaxis
- Highcharts How to get decimal point values on y-axis with big numbers
- Highcharts - Global configuration with common code and unique data & Headings
- Difference between highcharts and highstock during real time trace and xAxis with max value
- Highcharts problem with xAxis using multiple series
- Can't get csv from Highcharts
- Highcharts - How to populate date with Mysql and PHP?
- Date / Time problem in javascript with highcharts
- Only 3 steps on xAxis with type xAxis in Highcharts
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Highcharts plotLines with multiple xAxis and yAxis
- How can I make a graph with highcharts from csv file?
- Highcharts - Column chart with empty columns for date in x-axis
- How to deal in Highcharts with special characters from CSV file?
- How to get Highcharts XAxis to Display in 2 Minute Intervals
- Highstock Highcharts date time data on Xaxis
- passing formatting JavaScript code to HighCharts with JSON
- Highcharts - date on xAxis label difference on tooltip
More Query from same tag
- How to move tooltip position in Highchart?
- Highcharts not rendering labels from an html table
- I can't make Highcharts phantomJs export server work
- Strange behaviour of new mysql json selection syntax with Laravel
- How to enable/disable sections in Pie chart in Highcharts
- How to create chart with highchart in which bar doesn't start from 0 in y axis?
- How can I make Highcharts label a datetime X-axis with relative dates?
- JavaScript/Hightables - Add unique items with time and output percentage
- how to use javascript variable for complete series data
- Highcharts timeline chart with multiple axes
- Change marker width and height in scatter chart
- HighChart graphics with node js and react js
- Highcharts show blank colum with text
- how do i link my sqlite(PDO) databse data to highcharts code
- JSFiddle API examples are broken
- highcharts donut chart center text overlaps with tooltip
- Highcharts-legend-item.last() disappears when changing tab
- Is it possible to customize the features of stack parameter in highchart.js library
- how to show labels in right side in chart?
- Highcharts exporting hide data labels if number doesn't fit in stacked bar
- Two columns with two legend items in highchars.js
- HightCharts : area range and spline in the same graph issue
- Build a highchart chart using data from an external JSON
- How do I initialize HighChart series values with AJAX?
- Highcharts.js: scrollable innterText?
- HIghcharts Legend Symbol Getting out of graph Canvas
- Mongodb + Stacked Highcharts
- Highcharts check box for y axis
- Adding multiple dynamic lines to highcharts
- Fix both y-axis to 0 highcharts