문제

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)

도움이 되었습니까?

해결책

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"
    }]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top