mirelon
mirelon

Reputation: 4996

Highcharts area fillOpacity do not work when changing the color

I want an area chart with opacity 0.1. If I do not specify the color, everything works fine:

plotOptions: {
    series: {
        fillOpacity: 0.1
    }
}
series: [{
   name: '1',
   data: [1,2,3],
   type: 'area'
}

But when I change the color, the opacity is ignored:

plotOptions: {
    series: {
        fillOpacity: 0.1
    }
}
series: [{
   name: '2',
   data: [0,1,2],
   type: 'area'
   color: 'red'
}

See http://jsfiddle.net/4HkXf/

Upvotes: 13

Views: 18224

Answers (4)

Senaphet
Senaphet

Reputation: 35

fillOpacity: 0.1,
color: "rgb(0,0,0)"

seems to work on all browsers

fillOpacity: 0.1,
color: "#000"

does not work on all browsers

color: "rgba(0,0,0,0.1)"

does not work on all browsers

Upvotes: 2

Mike K
Mike K

Reputation: 639

I resolved it by removing fillOpacity, and instead specifying opacity as part of the color using rbga:

series: [{
    name: 'Buy / Sell ',
    data: data.shares_change,
    type: 'column',
    color: 'rgba(0,128,0,0.4)', // #080
    negativeColor: 'rgba(128,0,0,0.4)', // #800
    pointWidth: 8
}]

Upvotes: 5

Sebastian Bochan
Sebastian Bochan

Reputation: 37578

Please use color as hex i.e "#ff0000" instead of 'red'.

http://jsfiddle.net/4HkXf/3/

Upvotes: 17

Strikers
Strikers

Reputation: 4776

I can't say exactly what the reason is.

but, here is the solution for it

use type in chart level

chart:{
type: 'area'
}

this will be applied to all the series

here is your updated fiddle http://jsfiddle.net/4HkXf/1/

hope this will be of some use to you.

Upvotes: 0

Related Questions