Reputation: 591
Right now, my bar and legend looks like this. It is just a single color.
However, I am trying to add a pattern that does not exist within the default pattern fills. I want it to look like this.
I have looked quite a bit online, but can't seem to find anything to help me here. I have both an SVG and PNG for the pattern. Can anyone help me?
Upvotes: 1
Views: 322
Reputation: 12717
<script src="https://code.highcharts.com/modules/pattern-fill.js"></script>
series: [{
showInLegend: true,
type: 'bar',
color: {
pattern: {
image: 'https://freesvg.org/img/dot-seamless-pattern.png',
width:150,
height:150
}
},
You can set an image as a pattern anywhere you can use a color. I used a png here, but I would recommend an svg.
https://jsfiddle.net/blaird/2jwL13oc/1/
Upvotes: 1