This is a migrated thread and some comments may be shown as answers.

Altering the 'stroke' of a series & hiding the tool tip.

2 Answers 158 Views
Charts
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
Iron
John asked on 25 Jan 2016, 01:09 AM

I'd like to change the stroke colour of a stack in my bar chart.

Ideally I aim to make it totally hidden (it's essentially a filler and is required to be present in the chart, but not visible. Sounds odd I know, but there you go).

In the snippet below the stack Bravo has two sets of data. Charlie and Delta. Charlie is the 'hidden' data, it helps prop up Delta. I can make it invisible by setting the color to 'none' and I can hide it from being in the legend.

But, it still has a black outline (stroke) and I'd like to remove that.

I would also like to remove the tooltip for Charlie, but retain it for all the other data.

 Any help would be appreciated. Thanks.

This is a snippet of my code:

series: [{
                        colorField: "valueColor",
                        name: "Alpha",
                        stack: "Alpha",
                        data: "[value,value,value]"
                    }, {
                        name: "Charlie",
                        stack: "Bravo",
                        data: "[value,value,value]",
                        color: "none",
                        visibleInLegend: false
                    }, {
                        name: "Delta",
                        stack: "Bravo,
                        data: "[value,value,value]",
                        color: "#dcdcde"

}]

2 Answers, 1 is accepted

Sort by
0
Accepted
EZ
Top achievements
Rank 2
answered on 25 Jan 2016, 02:25 PM

You could set the border width to 0 and move the tooltip definitions into the series you want them for:

 DOJO DEMO

series: [{
    name: "Alpha",
    stack: "Alpha",
    data: [40, 32, 34, 36, ],
    color: "#f3ac32",
    tooltip: {
      visible: true,
      template: "#= series.name #: #= value #"
    }
}, {
    name: "Charlie",
    stack: "Bravo",
    data: [19, 25, 21, 26, ],
    color: "none",
    visibleInLegend: false,
    border: {
      width: 0
    }
}, {
    name: "Delta",
    stack: "Bravo",
    data: [17, 17, 16, 28, ],
    color: "#dcdcde",
    tooltip: {
      visible: true,
      template: "#= series.name #: #= value #"
    }
}],

0
John
Top achievements
Rank 2
Iron
answered on 25 Jan 2016, 08:37 PM
Fantastic answer. Solved my problem. Many Thanks!
Tags
Charts
Asked by
John
Top achievements
Rank 2
Iron
Answers by
EZ
Top achievements
Rank 2
John
Top achievements
Rank 2
Iron
Share this question
or