plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Add `marker.opacity` to bar traces

Open saimaparveen opened this issue 9 years ago • 4 comments

Hi,

Opacity of bar chart not changing. https://codepen.io/saimaparveen/pen/WOgKYJ

If i remove type:'bar' for scatter plot opacity is working fine.

Thanks, Saima Parveen

saimaparveen avatar Jul 07 '17 16:07 saimaparveen

CodePen w/o commented-out blocks: https://codepen.io/etpinard/pen/xrayzz?editors=1010

@saimaparveen Thanks for report!

etpinard avatar Jul 07 '17 18:07 etpinard

Is there any workaround for this issue?

saimaparveen avatar Jul 10 '17 06:07 saimaparveen

Is there any workaround for this issue?

Try plotting separate traces with different scalar opacity values or wait for a patch.

etpinard avatar Jul 10 '17 14:07 etpinard

After looking at this more closely, it appears that marker.opacity has never been part of bar trace schema in v1.x. So this ticket isn't a bug. Passing the data array from the codepen above to Plotly.validate correctly outputs key marker.opacity is not part of the schema .

I wouldn't be opposed to adding marker.opacity to bar traces, but this will be a low-priority ticket in the short term. Community PRs are welcomed though.

Note that trace-wide opacity scalar values due work for bars and setting marker.color as rgba values also works. See https://codepen.io/etpinard/pen/JJqjgy?editors=1010

etpinard avatar Jul 17 '17 17:07 etpinard