score:0
I think you have to use Highcharts.dateFormat.
Below is example which i am using.
xAxis: [{
categories: categories,
labels: {
formatter: function() {
return Highcharts.dateFormat('%H:%M', this.value);
},
style: {
'font-size': '11px',
},
},
type: 'datetime',
}],
Hope this will helpful to you.
score:0
I've managed to get it working.
Issues were the extra square brackets on the json and the "" round the temperature values.
Issue with the x axis as in the pointInterval being set to day rather than hour.
Working code below
$(document).ready(function() {
var options = {
chart: {
renderTo: 'container',
type: 'spline'
},
title: {
text: 'Temperature'
},
subtitle: {
text: 'Todays temperature trend'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
hour: '%H:%M'
},
title: {
text: 'Time'
}
},
yAxis: {
title: {
text: 'Temperature (c)'
}},
tooltip: {
valueSuffix: ' c'
},
series: [{name: 'Temperature', pointStart: Date.UTC(2017, 2, 17, 1),
pointInterval: 3600 * 1000}]
};
$.getJSON('temp.json', function(data) {
options.series[0].data = data;
var chart = new Highcharts.Chart(options);
});
});
Source: stackoverflow.com
Related Query
- How to get time and value from MySQL into Highcharts
- how to make chart real time with 2 line and get data from php with highcharts
- How do I get DateTime from mysql and set it to json format ready for highcharts
- How to remove the value and number labels from Highcharts angular gauge
- How to get current date and time on highcharts
- How to get data for series and categories in highcharts-convert.js from mysql
- How to get data from multiple tables of MySQL DB and manuplate it using PHP to display graphs?
- How to plot data in Highcharts where time and value are swapped?
- Highcharts - How to get Max and Min value between 2 dates
- How to set High charts series with X and Y value from mysql database
- how to get each key and value from object in javascript for high chart graph
- Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance?
- Highcharts - How to start x axis from an arbitrary value
- Highcharts - How to hide series name and Y value in tooltip
- How do I get the value of a highcharts graph point on mouseover?
- How to get multiple data series into Highcharts
- Highcharts - How to get a value of a stack in a series?
- Highcharts - How can I remove starting and ending padding from area chart
- *Highcharts* How to get the min and max value of the zoom box
- High chart - Column Range Chart with Time range. How to get tooltip as Start and End time
- Difference between highcharts and highstock during real time trace and xAxis with max value
- Highcharts - How to populate date with Mysql and PHP?
- How to get the highlighted point from shared tooltip formatter, Highcharts
- How to change space value between grid and yAxis in Highcharts line chart
- How to suppress items with NULL value from HighCharts legend
- how to get value from other script? (in html)
- How To Get Data From Database To Highcharts Plugin in cakephp
- how to get last value shown yAxis highcharts
- How to add exporting date and time as user format in Highcharts exporter?
- How can I unescape and remove quot; from data served by rails into javascript
More Query from same tag
- Highcharts show menu buttons alongside blank title
- Update xAxis individual label position for printing Highcharts
- Highcharts addPoint function show nothing
- Width of column in columnchart using highcharts
- highcharts positioner tooltip - general javascript
- Unable to Create Chart in Highcharts and id is undefined
- Animation origin of Highcharts library
- How to interpret Timelien for HighStock
- Rails 4.1 Error Loading Chart: No adapter found highcharts
- Highmaps label centering in irregular path
- Highcharts series label
- Highchart stacked area series is not showing correctly
- How to reduce the margin above a polar chart with HighCharts?
- Issue on Formatting Highcharts.js yAxis Value
- how to make series in highcharts toggle between cursors
- Convert c# date to Javascript
- Getting value from tooltip when hover on svg element on the graph created with highcharts
- HighCharts: Can I call the Exporting functions directly?
- add formatter for X-axis in Highchart
- Not able to hover on each line in Highcharts's Parallel Coordinate chart
- Show highchart graph in modal on same page by clicking on graph
- addSeriesAsDrilldown not working
- How to set color for non plotting Area in HighChart
- Highcharts sankey. Highlight all paths of a given category
- Highcharts can't render a bubble chart with a single series
- Stacked bar chart from JSON file - seems to be ignoring a value
- Highcharts fill map based on data values with React TypeScript
- HighCharts - set minimum Tick Interval
- Uncaught TypeError: Object [object Object] has no method 'highcharts' while loading highstock chart
- Resize height with Highcharts