Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Patterned shape fills
posted

Guy,

I need to colour regions on a map according to the political party of the elected member for that region.  Unfortunately, some regions have two elected members, and I need the fill colouring to reflect both parties, for example a striped fill colour for that region, like Macleans toothpaste. 

I have been looking at one of the standard samples, which uses a callback function via the shapeStyleSelector attributor of the igMap series to set the shape colours dynamically.  This returns a record of the form:

return {
 fill: colString, 
 stroke: "gray"
};

Where colstring is a standard colour, or an rgba() value. 

The fill attribute looks like it probably maps onto the fillstyle attribute of the HTML 5 shape, which can accept  a color, gradient, or pattern.    So, I have had a go at passing a gradient or pattern to the fill attribute.  Alas, it just seems only to take a single colour out of whatever I pass it.  

Is this expected behaviour?  

Is there any other way to solve my problem?

On more detailed note, is there a recommended way to find the canvas object in the  shapeStyleSelector callback function?


Any ideas welcome.  If I cannot crack this I'll have to look at another tool, unfortunately.


Mark

Parents Reply Children
No Data