score:11
Accepted answer
you can do this by enabling datalabels, and customising them. you will also need to format your data in a particular way:
$(function () {
$('#container').highcharts({
chart: { type:'bar',
},
xaxis: {
categories: ['device 1', 'device 2']
},
plotoptions: {
series: {
datalabels: {
enabled: true,
formatter:function() {
return this.point.t;
}
}
}
},
series: [{
data: [{y:29.9,t:"12:45"}, {y:71.5,t:"14:45"}]
}]
});
});
the data in this example has an additional field defined 't' which contains the time you want to show on the bar. in the datalabel formatter function, you can refer to all the data within each point, including 't' using this.point.t.
score:4
please share your code...
did you looking for this...
call opendata() function from your highcharts series data
series: [{
name: 'barname',
data: opendata()
}]
opendata() function
function opendata() {
var fromdate =$('#startdate').val();
var todate = $('#expiredate').val();
if(fromdate == '' || todate == '' ){
// return false;
}
var data = 'fromdate='+fromdate+'&todate='+todate;
$.ajax({
url: 'apappopenchart.php',
data: data,
success: function(data) {
var chartdata=[];
var retdata = jquery.parsejson(data);
var length =retdata.length;
for(var i=0; i<length; i++){
var jsdate = new date(retdata[i][0]*1000);
var datejs = jsdate.getfullyear()+','+jsdate.getmonth()+','+jsdate.getdate();
}
chart.series[0].setdata(retdata);
chart.redraw();
},
cache: false
});
}
Source: stackoverflow.com
Related Query
- print a value on highcharts bar graph?
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- missing value in highcharts line graph results in no line, just points
- Highcharts Change Bar Color Based on Value
- Highcharts dynamically change bar color based on value
- How to hyperlink bar graph in highcharts
- How do I get the value of a highcharts graph point on mouseover?
- Highcharts stacked bar graph as timeline
- Highcharts: How to provide a custom stack label in highcharts bar graph from within the stackLabel formatter?
- How to change area graph color above certain value in Highcharts
- Highcharts Change Bar Background Color Based on categories value
- Show all labels in highcharts horizontal bar graph
- Adding round corners to Highcharts Bar Chart with stacked bars when value is 0
- Dynamically set click event on bar from highcharts graph
- Highcharts highstocks - candlestick graph has last value partially cut
- Highcharts Backgroundimage for bar graph
- Highcharts Graph displaying 0 value continuously : Javascript Array
- How to create a single series bar graph with Highcharts
- Need a single border for stacked bar graph in Highcharts
- Plot a bar graph using Highcharts drilldown with two different JSON end points
- highcharts - Not able to switch between bar to column or vice versa graph type in drilldown
- How to achieve linear gradient for bar graph in highcharts
- Tooltip for Highcharts graph shows "undefined" in Chrome, but the correct value in Firefox
- Inserting Highcharts bar graph into sharepoint 2013 page
- My Highcharts graph with multiple axis ignores the max value I set for the first yaxis
- I'm trying to create a bar graph with Highcharts JS, but the bars won't draw on the graph?
- highcharts bar graph from json
- Make bar graph using highcharts from entries in the database
- Displaying a target area / value on a HighCharts graph
- Highcharts - Column Chart Drilldown, how to change the drilldown bar color based on some value
More Query from same tag
- SVGRenderer function
- Scatter chart plot on border if values are outside the bounderies
- onclick trigger resize, highcharts
- How can I disable the value tooltip on a Vaadin-Charts/Highcharts SolidGauge chart?
- How to get PlotBands data to show up on HighChart chart?
- Why does my HighStock data drop off when I zoom out?
- How to drilldown a stacked column highchart to show all stacks instead of clicked
- Is it possible to style columnrange highchart to change color when data is below 0?
- how to create on click event after drilldown
- SignalR update breaks layout and scripts on page
- Trying to pass JSON data to Highcharts without success
- How can I show only one x-axis in synchronous chart highchart
- Highcharts - issue about full chart width
- Unable to customize the box to short single line in 'boxplot' type Highcharts
- Highchart doesn't display in IE7/8
- Highchart UTC date always set to January, 1 1970
- How to make legend labels to bring out the series of a pie chart and not make them disappear when label is clicked in HighCharts?
- Different border radius
- highcharts IE8 redraw chart issue
- Not able to align highchart made using angular js
- Would it be possible to make two columns which belong to different series respectively to be placed exactly on the tick on x-axis with highchart?
- Highcharts not displaying anything just blank html page
- Shared legend of charts in react-highcharts?
- Highcharts error 13, but rendering Div exists
- multiple color axis for different parent groups of treemap highcharts
- Highcharts: Trigger showing tooltip programatically with selenium
- Does Highcharts have a "trend line" feature?
- Problem injecting variable-pie chart with highcharts-export-server
- Angular Highcharts redraw
- Title in top column charts