BarGraph and PieChart: to apply an image background to bar or pie

That is great, ZIM provides graphs. Is it possible to use an image as a background for the bar or pie to replace the color background or an icon?

There is a backgroundColor parameter as you mentioned, but for a background image, do not set it and put a new Pic() underneath. And Hello @kaviphim good to hear from you.

Thank you Dr. Abstract. And Hello! I am still around, behind the scene, always. I have been sick (2y) and it's been a slow recovery. But, i am back.

1 Like

Hello, Dr. Abstract, when you mention backgroundColor, you mean the backgroundColor of the PieChart. I want to apply the image at the wedge level. Each wedge will have its own image background.

I forgot to mention i looked at an the pieChart has a main circle and there is a shape attached to each wedge. I was able to use the circle of the pieChart. as a mask to the image. But i was able to idenitfy shape of a specific wedge, but was not able to use it to mask the image.

By the way, the shape i grabbed was the shape of the icon attached to the wedge.

I think i found the shape that represents the wedge. By using the shape of the wedge as a mask to the image, it works. But the position of the wedge has changed. Probably, it is because the imae and the shape are in different container.

The raw shapes may still have offsets when masking. When we made the ZIM shapes like circle, triangle, etc. we had to accommodate for the shift in createjs masking - pain in the neck. So if the mask is sort of working but showing in the top left corner... that might be it - I am just sitting down to a movie... will see if I can mask something in the pie chart a little later on.

I found the fix for the mask showing at the top left corner as you mentionned by adding the image in the backing of the graph.
All i need now, to continue the test is to know how to identify each shape related to the wedges. Can you give me a guideline on how to properly get those shapes?

The wedges are not actually different shapes - but rather one shape. So we make new shapes and use them as a mask... fun challenge.

Thank you. I will use your example as a gudeline.

1 Like