有没有办法通过突出显示属性将图像添加到 ExtJS 图表中的条形中?
我想在 onMouseOver 的列/栏中添加一个图标,并且想知道突出显示是否已经支持该图标。文档说您可以将任何可用的 Sprite 添加到突出显示对象( http://docs.sencha.com/ext-js/4-0/#/api/Ext.chart.series.Bar-cfg-highlight 然而即使在精灵定义 ( http://docs.sencha.com/ext-js /4-0/#/api/Ext.draw.Sprite )除了将类型设置为图像之外,没有提及如何执行此操作,
任何想法将不胜感激
!
I want to add an icon in the column/bar onMouseOver and was wondering if highlight already supported that. The docs say you can add whatever Sprite has available to the highlight object ( http://docs.sencha.com/ext-js/4-0/#/api/Ext.chart.series.Bar-cfg-highlight however even in the Sprite definition ( http://docs.sencha.com/ext-js/4-0/#/api/Ext.draw.Sprite ) there's no mention of how to do this beyond setting the type to image.
Any ideas would be greatly appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从文档来看,似乎没有一种简单的方法可以做到这一点。 Sprite 类支持
addCls
和removeCls
方法,但您可以尝试为 sprite 元素设置 className,并查看具有该 className 的元素的背景图像是否有效。否则,条形图的精灵元素必须重新定义为更复杂的元素,将图像作为组件。将来,您应该在 Sencha 论坛 上发帖,因为您会得到更快的回复。
From the docs there doesn't seem to be an easy way of doing this. The Sprite class supports
addCls
andremoveCls
methods though, you could try setting a className to the sprite element and see whether a background image for an element with that className works. Otherwise the sprite element for the bar chart would have to be redefined into something more complex that takes images as a component.In future, you should post over on the Sencha forums as you will get a quicker response.