Home forums Using CanvasJS Stacked column with fill patterns Reply To: Stacked column with fill patterns



Hi Vishwas,

Thanks for quick reply.

I dont need gradient, I need user defined JPG/PNG images as backgrounds instead of color specified in the data sample earlier. i.e. something like this:

data: [{
                            type: "stackedColumn",
                            showInLegend: true,
                            color: "url(images/sand.jpg)",
                            name: "Basalt",
                            dataPoints: [
                                {y: 0, x: 0},
                                {y: 0, x: 12},

please note here I want to replace the hex color value with an image, typically used in web pages like
<div style="background:url('images/sand.jpg')">DIV Content goes here</div> wherein this DIV will have my image as background to the content.

So in a stacked column, say I have 4 data items in 1 column, I will have them with 4 different images. At present I can only specify hex value of a color.

I was unable to add a sample image here as the “img” tag of this editor needs a URL.


  • This reply was modified 3 weeks ago by  sgjoshi.