在yAxis中显示带有缩略图的条形图,而不是标签 [英] Display bar chart with thumbnails in yAxis instead of label

查看:131
本文介绍了在yAxis中显示带有缩略图的条形图,而不是标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用了两个图表库. ECharts

I am using two charts libraries in my project. ECharts and Google Charts.

我想显示带有缩略图的条形图.我需要显示横幅日志.

I want to display bar chart with thumbnails. I need to display log of banners.

所以我将需要像下面这样的图表,只是轴上的图像.

So i will need chart like below just images in axis.

我不确定上述任何一个库是否可以实现.

I am not sure it is possible or not with any of above library.

如果有人有任何想法,请告诉我.

If anyone has any ideas then please let me know.

推荐答案

echarts支持rich text作为标签

echarts support rich text as label

在选项yAxis或xAixs-> axisLabel->丰富,

in the option yAxis or xAixs -> axisLabel -> rich,

检查此 example1 example2

yAxis: {
    type: 'category',
    data: ['Sunny', 'Cloudy', 'Showers'],
    axisLabel: {
        formatter: function (value) {
            return '{' + value + '| }\n{value|' + value + '}';
        },
        margin: 20,
        rich: {
            value: {
                lineHeight: 30,
                align: 'center'
            },
            Sunny: {
                height: 40,
                align: 'center',
                backgroundColor: {
                    image: weatherIcons.Sunny
                }
            },
            Cloudy: {
                height: 40,
                align: 'center',
                backgroundColor: {
                    image: weatherIcons.Cloudy
                }
            },
            Showers: {
                height: 40,
                align: 'center',
                backgroundColor: {
                    image: weatherIcons.Showers
                }
            }
        }
    }
}

这篇关于在yAxis中显示带有缩略图的条形图,而不是标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆