score:1
Yes, this is absolutely possible, and you were on the right track with your research of multiple y-axes.
Below is a code snippet based on Highcharts' demo of stacked and grouped columns. I added a second y-axis and copied some of the demo data to assign to that axis.
Per your requirements, you'll find two sets, or stacks, of data assigned to the first/default y-axis, and a third set assigned to the second/opposite y-axis.
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Total fruit consumtion, grouped by gender'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: [{
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
},{
allowDecimals: false,
min: 0, max: 100,
title: {
text: 'Percentage of fruits'
},
opposite: true
}],
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal'
}
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2],
stack: 'number'
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5],
stack: 'number'
}, {
name: 'Jane',
data: [2, 5, 6, 2, 1],
stack: 'number2'
}, {
name: 'Janet',
data: [3, 0, 4, 4, 3],
stack: 'number2'
},{
name: 'John',
data: [45, 30, 25, 70, 5],
stack: 'percentage',
yAxis: 1
}, {
name: 'Joe',
data: [25, 15, 40, 5, 5],
stack: 'percentage',
yAxis: 1
}, {
name: 'Jane',
data: [10, 50, 30, 5, 10],
stack: 'percentage',
yAxis: 1
}, {
name: 'Janet',
data: [20, 5, 5, 20, 80],
stack: 'percentage',
yAxis: 1
}]
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="width: 600px; height: 250px; margin: 0 auto"></div>
One piece of advice: as with line charts on different axes, you need to be clear in your documentation, color choices, or chart labels so that users know which values correspond to which axis. This is particularly needed for columns, as users will naturally compare the heights of each column to its neighbor.
I hope this is helpful for you.
score:6
So here's my solution to your problem. I hope this is what you are looking for and I hope you find this helpful.
When you want to put the data into three categories with two different yAxis' you'd have to split it up in series like this. The percent is linked to the series with the values.
If you want it back to a column chart, just change the chart type to column.
http://jsfiddle.net/henrikskar/j1o450z5/
series: [{
name: 'John',
id: 's1',
data: [5, 3],
},{
//Links to id s1
linkedTo: 's1',
name: 'John',
data: [
//Puts 0.4 percent to the third category which is in the second array position
//of the categories
[2, 0.4]
],
//Assigns the percent to the second yAxis
yAxis: 1,
color: Highcharts.getOptions().colors[0]
},
Source: stackoverflow.com
Related Query
- Highcharts grouped bar charts with multiple axes
- Highcharts synchronized charts with multiple axes datasets
- Highcharts - Issue with negative values when displaying multiple axes
- Highcharts Grouped Column Chart with Multiple Groups?
- Highcharts shared tooltip between charts with multiple series and shared tooltip
- Highcharts multiple column chart with drilldown, correct formatting of drilldown axes
- Spiderweb Highcharts with multiple scales on multiple axes
- Highcharts redundant time data with multiple axes
- Highcharts synchronize tooltip on multiple charts with multiple series
- Charts using Highcharts with multiple series from JSON
- Highcharts timeline chart with multiple axes
- How to make split grouped column bar chart in highcharts with percentage?
- Using Highcharts to show multiple stacked bar charts next to each other
- Highcharts drilldown to pie chart - Clicking on axis label with multiple series causes pie charts to overlap
- Highcharts format labels on grouped stacked bar diagram with $ k, M for currency and 'hrs' for time
- Enable Horizontal Scrollbar in Highcharts with Multiple Pie Charts
- How to have multiple highcharts with different series data in vuejs without repeating code
- Multiple charts with same data not loading in same page: Highcharts
- High charts Issue with stock bar chart multiple line series
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- Highcharts Synchronisation of multiple charts with different sizes
- How to update multiple highcharts charts with one function
- Highcharts - Pinch zoom does not work on chart with multiple y axes
- Can't make multiple charts to work with highcharts
- Highcharts issue with multiple X axes
- bar charts with grouped column
- Highcharts - Multiple charts with same object
- Highcharts multiple column bar chart with "fill" effect
- Highcharts Dynamic Updated Highstock Charts doesn't display along with Bar Chart
- Maximum bar width in Highcharts column charts
More Query from same tag
- Make RangeSelector into dropdown Highcharts
- HighCharts Live Data using mqtt
- How to add two dataLabels to a bar chart using HightCharts
- Highcharts - spider web chart questions
- highcharts how to load data via ajax
- Highcharts won't display in Chrome App
- How to hide columns with no data in HighCharts
- Highcharts Transition from Column to Spiderweb
- Using highcharter to return multiple data with Shiny
- Json in perfect form but Highcharts chart won't populate
- Move label above bar
- HighCharts - Bar Chart - Labels like Pie Chart?
- Shared tooltip on multiple charts not formatting correctly
- How to import Highmaps map collection in Angular 6
- Highcharts - PDF export format; font sizes for bar chart axis
- Line graph disappears after new line is added
- How do you change plotBackGroundColor dynamically if value exceeds a maxium value in Highcharts?
- How to input null into highcharts and then ignore it in line graph?
- How to prevent Highstock from hiding data rows
- How to enable marker on hover only for a range of points in highcharts
- Create spline chart from edge to edge of graph
- Sending Ember Highcharts events back to parent component
- Highcharts - init with different vertical/horizontal config based on browser width, also after resize
- Change color of different points in same series Highcharts
- Highcharts: how to dynamically update text inside of the label?
- Combine an object parameter with array values in Highcharts reduce method
- Legend item hiding/showing other legend items
- Wrong x-axis min max values Highcharts
- HighChart not getting data from server side?Error in parseJSON
- How to create Duplicate DataLabels in highcharts