score:1
Accepted answer
When manipulating width
of axes, you can use percentages. Take a look at the example below.
API Reference:
http://api.highcharts.com/highcharts/xAxis.categories
http://api.highcharts.com/highcharts/plotOptions.bar.pointPadding
Example:
http://jsfiddle.net/vkzzbvgw/
score:0
Managed to get a rough version working:
http://jsfiddle.net/willycheung/xqw1x012/4/
var categories = ['<strong>Michael Bachman</strong><br>90% ($2.42M)', '<strong>Neil Anderson</strong><br>85% ($2.15M, <span style="color:orange">$750k</span>)', '<strong>Kelvin Luis</strong><br>63% ($1.5M)', '<strong>Steven Yellen</strong><br>62% ($1.2M, <span style="color:orange">$45k</span>)', '<strong>Richard Wally</strong><br>60% ($952K)', '<strong>Varian Lopez</strong><br>40% ($125K)', '<strong>Charlie Schema</strong><br>38% ($120K, <span style="color:red">$80k</span>)', '<strong>Ben Shorty<strong><br>36% ($450K, <span style="color:red">$120k</span>)', '<strong>Stephanie Smiles</strong><br>28% ($550K)', '<strong>Bruce Wallus</strong><br>25% ($104K)',
'<strong>Rick Martin</strong><br>24% ($390K)', '<strong>Natale Salesy</strong><br>21% ($330K)'];
$(document).ready(function () {
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: null
},
xAxis: [{
categories: categories,
gridLineidth: 0,
minorGridLineWidth: 0,
lineWidth: 0,
tickWidth: 0,
labels: {
enabled: false
}
}, { // miror axis on right side
categories: categories,
gridLineWidth: 0,
minorGridLineWidth: 0,
lineWidth: 0,
tickWidth: 0,
linkedTo: 0,
labels: {
align: 'center'
}
}],
yAxis: [{
title: {
text: null
},
labels: {
enabled: false
},
gridLineWidth: 0,
minorGridLineWidth: 0,
lineWidth: 0,
left:-60,
width: 250
},{
title: {
text: null
},
labels: {
enabled: false
},
gridLineWidth: 0,
minorGridLineWidth: 0,
lineWidth: 0,
left:300,
width: 250
}],
plotOptions: {
series: {
stacking: 'normal'
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + ', age ' + this.point.category + '</b><br/>' +
'Population: ' + Highcharts.numberFormat(Math.abs(this.point.y), 0);
}
},
series: [{
name: 'Male',
data: [-2.2, -2.2, -2.3, -2.5, -2.7, -3.1, -3.2,
-3.0, -3.2, -4.3, -4.4, -3.6]
}, {
name: 'Female',
yAxis: 1,
data: [2.1, 2.0, 2.2, 2.4, 2.6, 3.0, 3.1, 2.9,
3.1, 4.1, 4.3, 3.6]
}]
});
});
Source: stackoverflow.com
Related Query
- Highcharts how to draw dual axis negative stack bar?
- Draw Line in Bar with negative stack in HighCharts
- Highcharts: How to provide a custom stack label in highcharts bar graph from within the stackLabel formatter?
- Highcharts bar with negative stack: how to position data labels
- How to resize bar chart based on no of x axis categories in HighCharts
- How to draw a bar chart that one series has both positive and negative values in Highcharts?
- how to zoom dual x axis at same time in highcharts
- How to modify Negative Axis Bar Graph in Highcharts?
- How can I draw Highcharts horizontal stacked bar with date-time duration
- How to position Highcharts tooltip on top of bar or at 0 line of Y-axis for negative value
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- How to hide the Axis line in stack bar chart high chart
- How to setting to draw a line connect the stack bar
- Highcharts annotations - how to draw rectangle by axis points?
- how to draw end line on x axis in highcharts
- How do I rotate my HighCharts bar chart so its vertical, not horizontal?
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How to draw vertical lines on Highcharts graph?
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- How to hyperlink bar graph in highcharts
- Highcharts how to change x axis options
- Highcharts - How to start x axis from an arbitrary value
- Highcharts - How to get a value of a stack in a series?
- How to add space between chart and axis in highcharts
- Highcharts Bar Chart - How to set the minimum bar width/length
- How to change axis label size when exporting in Highcharts / Highstock
- How to add a label above each bar in HighCharts
- Dual axis using percentage and absolute value to same serie in Highcharts
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
More Query from same tag
- Highcharts - Custom toggle button using the exporting buttons
- fix height of column in stacked percentage column highcharts
- Try to offline exporting to Highcharts
- Is it possible to get highcharts range selector to work with jQuery timepicker, like it works with jQuery datepicker?
- issues with HighCharts
- Need a single border for stacked bar graph in Highcharts
- Alignment issue in high charts
- Highcharts two date compare
- Distance between x-axis labels and the chart in Highcharts
- How do get highcharts combo column scatter to work?
- Highcharts: Updating a Pie Chart with setData()
- Width of embedded HighChart within jQuery dialog only 100% after resizing window screen
- Highcharts Auto Calculate Multiple Series Position
- Highcharts datetime axis, how to disable time part (show only dates)?
- I have correct XPath but selenium is not clicking in Highcharts popup
- Highcharts columns have no width (seemingly arbitrarily)
- Nothing displayed in Highchart Column
- Adding Text into Center of Pie Graph highcharts
- Formatting Highcharts labels with a callback function (Formatter)
- Highcharts, get point index when shared tooltip is shows/hides
- Highchart: show seconday y-axis tick positions 0 to 12
- How do I change the line width of the area polygon in highchart?
- Highchart Zoom and X-Axis with String Array for Categories
- Adjust space to the sides of highchart series
- Highcharts: show just 1 marker from an arearange type of series
- Highcharts chart going blank on zoomType: 'x' area range zoom?
- Highcharts use series labels as x-axis categories
- Highcharts data module and CSV: Displaying data points differently
- How to correct mouse event in Highcharts
- Highmaps - Editing the css of state names on map