Question

i tried this: http://jsfiddle.net/3kpTK/1/ In this example i have several two groups that contain two types of information: "move" and "delete.

series: [{
            name: "group1",
            data: [50,20,30,50],
            stack: "move"
        }, {
            name: "group1",
            data: [10,23,0,52],
            stack:"delete"
        },{
            name: "group2",
            data: [50,20,30,50],
            stack: "move"
        }, {
            name: "group2",
            data: [10,23,0,52],
            stack:"delete"
        }

Highchart puts them into two different groups with the same name and different colors. I want to put in the same group, columns that are on different stacks but with same name. How can i do?

The output that i want in this example is formed by the two series "group1" and "group2".

EDIT: This is my real case example

In the legend the groups are double, for example batch production(move) is purple and batch production(delete) is light blue. I want only one "batch poduction" with one color for both(move,delete)

Was it helpful?

Solution

To get the same colors, you need to set them directly in series options. Then to get in legend only group 1 and 2 add ID's to the series and link next series within the same group. Example: http://jsfiddle.net/3kpTK/2/

    series: [{
        id: 'g1',
        color: 'blue',
        name: "group1",
        data: [50,20,30,50],
        stack: "move"
    }, {
        linkedTo: 'g1',
        color: 'blue',
        name: "group1",
        data: [10,23,0,52],
        stack:"delete"
    },{
        id: 'g2',
        color: 'green',
        name: "group2",
        data: [50,20,30,50],
        stack: "move"
    }, {
        linkedTo: 'g2',
        color: 'green',
        name: "group2",
        data: [10,23,0,52],
        stack:"delete"
    }]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top