Highchart with scaled images in column bars?

孤人 提交于 2019-12-01 11:40:22

I think it may be not possible using patterns, but you can add some images using renderer: http://jsfiddle.net/YZkPX/

    chart: {
        renderTo: 'container',
        type: 'column',
        events: {
            load: function () {
                var chart = this,
                    d = chart.series[0].data;

                for (var i = 0, len = d.length; i < len; i++) {
                    var p = d[i],
                        x = chart.plotLeft + p.plotX - p.pointWidth / 2,
                        y = chart.plotTop + p.plotY,
                        w = p.pointWidth,
                        h = p.graphic.height;
                    chart.renderer.image('http://www.aperfectworld.org/clipart/buildings/buildings08g.gif', x, y, w, h).add();

                }

            }
        }
    },

Now you need to recalculate x/y/w/h when series is redraw (zoom/show/hide etc.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!