jomas
Posts: 2
Joined: Thu Feb 25, 2016 9:16 am

Grouping: Column charts -> Stocked Percent

Hello,

i test a litte bit with Highcharts Cloud to figure out how i have to set my cvs for a later purpose.
I use the template Column charts -> Stocked Percent and i want to tell the template by my cvs, that its grouping 2 stocked Columns.
Is that possible for this template by cvs or how can i handle that?
I don't know if can configurate the grouping option by cvs for stocked columns or if i have to take another way.

For example: I want to group it like this but with percentage: http://www.highcharts.com/demo/3d-colum ... g-grouping

Could you please help me?

Best Regards,

Jomas
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: Grouping: Column charts -> Stocked Percent

Hi Jomas,

If you want to create a column percentage stacked chart with multiple stacks, then you would have to set stacks for series.
API: http://api.highcharts.com/highcharts#se ... umn>.stack

To set this option in Highcharts Cloud you could add in "Customize > Code > Custom code" a code that will set stacks for each series. If you will have 4 series then you could use code like:

Code: Select all

options.series[0].stack = 'stackA';
options.series[1].stack = 'stackA';
options.series[2].stack = 'stackB';
options.series[3].stack = 'stackB';
If you will have more questions or problems, please feel free to ask.

Best Regards,
Kacper Madej
Kacper Madej
Highcharts Developer
jomas
Posts: 2
Joined: Thu Feb 25, 2016 9:16 am

Re: Grouping: Column charts -> Stocked Percent

Thank you for your answer! I added the stacks.
Further, i test a little bit more based on a highchart demo from jfiddle and create my own out of this in jfiddle: https://jsfiddle.net/20hdup4b/.
It looks good, but i have 1 new and 1 old problem.

The first thing is, that the bars in the first 3 groups are cutted and not reaching their head. The bars in the last 3 groups are fine. Do you know how i can handle this?

The other thing is, that i still don't know how my csv should be looks for this example, if i want to import the data by csv.
I like to use the data module. Can you help me and give me an example for the csv-file for this example?

Best Regards,

Jomas
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: Grouping: Column charts -> Stocked Percent

Hi Jomas,

The first thing is fixed in a github version of Highcharts - next release candidate.
Example: http://jsfiddle.net/3rg7qcu9/

If you want to pass more series options in CSV, then you could parse series names in complete function.
API: http://api.highcharts.com/highcharts#data.complete
Example: http://jsfiddle.net/b9bvccx5/1/
If you would need to set color from CSV or any other series option, then you could just add more to series name.

You could load categories from CSV too if you need - http://jsfiddle.net/02k3xoh1/

Let me know if you will have more questions.

Best Regards.
Kacper Madej
Highcharts Developer

Return to “Highcharts Cloud”