0

I am using Wijmo barcharts and am trying to create a graph which has images instead of labels on the x axis.

This is the code I have currently got, however, the image source is being printed out as a string rather than showing the image. Does anybody know of a way around this?

    $(document).ready(function () {
    defaultPalette = ['#e11a00', '#ddcd0e', '#005698'];
    $("#wijbarchart").wijbarchart({
        horizontal:false,
        hint: {
            content: function () {
                return this.data.label + '\n ' + this.y + '';
            }
        },
        seriesList: [{
            label: "Entries",
            legendEntry: true,
            data: { 
                x: [<img src="photos/image1.jpg" />,<img src="photos/image2.jpg" />,<img src="photos/image3.jpg" />],
                y: [22,10,65] 
            }
        }],
        painted: function (args) {
            var bars = $(this).data('fields').chartElements.bars
            if (bars.length > 0) {
                for (var i in bars) {
                    bars[i].attr({ fill: defaultPalette[i % defaultPalette.length]});
                }
            }
        },
        mouseOut: function (e, data) {
            data.bar.attr({ fill: defaultPalette[data.index % defaultPalette.length]});
        }
    });
});

Thanks!

CDK
  • 669
  • 1
  • 5
  • 17

1 Answers1

0

Currently, there is no support for displaying images in place of valuelabels. However, I have made an enhancement for same to the development team and hopefully, it will be supported in future builds.

Regards

Ashish

Ashish
  • 594
  • 1
  • 6
  • 12