score:1
Accepted answer
You can use momentjs
to convert your date
to epoch time
.
Here is a sample.
var ADBE = [
['2019-04-02 21:35:04',23.17],
['2019-04-02 22:35:04',23.78],
['2019-04-02 23:35:04',24.10],
['2019-04-03 20:35:04',23.86],
['2019-04-03 21:35:04',24.54]
];
ADBE = ADBE.map(function(data) { return [moment(data[0], "YYYY-MM-DD HH:mm:ss").valueOf(), data[1]]});
Highcharts.stockChart('container', {
rangeSelector: {
selected: 1
},
legend: {
enabled: true,
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
y: 100
},
series: [{
name: 'ADBE',
data: ADBE
}]
});
<div id="container" style="height: 400px; min-width: 600px"></div>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script type="text/javascript" src="https://www.highcharts.com/samples/data/three-series-1000-points.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
Source: stackoverflow.com
Related Query
- Datetime format for series - Highcharts
- How to format datetime for (x,y) pair data for Highcharts
- Highcharts - Aligning dateTime series for shared tooltip
- How do I get DateTime from mysql and set it to json format ready for highcharts
- Using highcharts x-axis "zones" for datetime series chart
- What format does the highcharts js library accept for dates?
- Changing data dynamically for a series in Highcharts
- Add additional data to a Highcharts series for use in formatters
- Display tooltip for invisible series in Highcharts
- HighCharts show datetime format on xAxis
- Highcharts - How to set custom colors for the series
- highcharts - chart names for multiple pie chart series in one chart
- Highcharts max interval for dateTime in x-axis?
- Use an array of objects for series data in Highcharts
- Highcharts Custom tooltips for multiple series
- Highcharts - Provide URL's for series data to open clickable link
- Highcharts shared tooltip for line series and scatter plot not working
- Highcharts label format with tickPositioner in a datetime x Axis
- Sort the series data for every X-Axis in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts not displaying series data for graph with multiple Y-axes
- Format Highcharts xAxis for stock data
- Highcharts JS- add third variable to tooltip for two series
- How to show 0 for incomplete Series in Highcharts
- How to format my json data for stack column chart in HighCharts
- Highcharts change label text for a single series
- How To Show All Data Labels For Datetime Axis In Highcharts
- how to use object as series for Highcharts
- jspdf is not able to capture the div content properly for highcharts to download as pdf format
- How to create data in Json format for highcharts
More Query from same tag
- Issues in Data Label
- Set custom image from bottom to top inside bars of bar graph (using highcharts)?
- Highcharts stocks - Scale candlesticks serie only
- Highmaps - Creating custom buttons using Exporting
- How do I show multiple datapoints in HighMaps?
- Setting data chart color - Highcharts
- Highcharts 9.1.1 export from fullscreen with print option- throw error on browser console Uncaught TypeError: a.hasAttribute is not a function
- Highchart- OnClick event, get "category" and "name" from stacked bar chart
- Sort of series values for xAxis
- ASP.NET Controller return variable View access
- Highcharts: Restricting nth label on a category axis
- Highcharts add points but not to all categories
- highcharts, gauge chart, update on slider
- How to add arrow to end of line while using type scatter
- HIghCharts dual axes combo
- How to link inside map to other map?, or how to change geojason dinaminacally?
- highchart change color of single bar in single category
- HighCharts synchronisation tooltip effect other chart
- Angular : SetData to HighChart widget from an array object
- Highstock clipPath calculation bug
- Fixing the decimals on y axis to 5 places
- Create custom Map for Highmaps using Shapefiles and QGIS
- (Highcharts) Display Newest Data From Text File Only
- highchart with dual axis breakpoint and drag point
- How can i loop data in highcharts
- Synchronize two highstock charts, same rangeSelector across two tabs
- Dynamic Labels for X axis in HighCharts
- Highstocks Multiple x-axis or just remove date and use numbering
- Convering yyyy-mm-dd to unix timestamp in array and put it back at the same position after converted it. [Javascript]
- Black image bug when exporting highcharts in Firefox