Background color and pattern transparency
Opened this issue ยท 15 comments
Hi ๐
I tweaked your plugin to add support for a background color as well as pattern opacity
to be able to keep columns color and add a pattern on top of it basically.
I can make it into a PR if you are interested
Hi Benjamin,
Yes it would be interesting to see what you did. It looks like the fill
isn't picked up here: http://jsfiddle.net/highcharts/jzy1unsv/3/.
But opacity can already be set using rgba colors, right? (same jsFiddle).
In my use case, the pattern is a png file ๐
let me do a PR so we can discuss it ๐
I would love to have the ability to set a background color and overlay the pattern. Is #17 still in merge limbo? or is there an alternate method for doing this? Thanks for the great plugin.
in merge limbo pretty much ๐
I should clean it (or uglify it again, depends on the point of view ๐)
I'll do it
Just checking - I appreciate those contributing back to projects. I haven't managed to find time to help, so I can only be thankful for everyone's hard work and time. Thanks to both of you.
I made new PR #18
Hi,
I tested the pattern demo (http://jsfiddle.net/highcharts/jzy1unsv/) [windows7 - IE11] and found two problems:
- If closed paths are used like e.g. for the
url(#highcharts-default-pattern-5)
, the fill color is not set for the pattern, but only for the background (see fig1). The fill color for the pattern is default (black).
- Opacity is not set, because the member
pattern.element.children
is unknown. (DOM4)
Proposed solutions:
- use "color" option of pattern for background and "fill" option for path. The result is in fig2 for no background (no color option) ;
and fig3 with a yellow background (and no fill of the pattern, hence transparent).
For the latter I added the color-option to the default pattern, but that is of course a choice. I have not included that in the patch.
renderer.addPattern('highcharts-default-pattern-' + i, { color: 'yellow', path: { d:pattern, stroke: colors[i], fill: 'none' }
- use member
pattern.element.childNodes
instead. To select only element nodes, the nodeType is checked.
A patch file is added.
pattern-fill-v2.js.patch.txt
Dirk.
Any advance on this? I could really use the ability to have two colors displayed with a single pattern. My hope is to communicate a range stack that is a combination of the stack below and above. TIA
@DirkDeWachter sorry I missed your patch ๐ I will try to have a look asap
OK.
Here are the files.
highcharts4-patternfill.zip
thanks ๐ I will have a look on friday
@DirkDeWachter I think you should try to open your own PR as it looks like this one is never gonna be accepted ๐
+1