[英]EXTJS 5 Chart ToolTip Using “sencha-charts” on require[] not working
Im currently using ExtJs5 MVVM architecture and I require "sencha-chart" than "ext-chart" on the app.json file, Charts works fine but adding tooltip on the bar series im using doesn't work. 我目前正在使用ExtJs5 MVVM体系结构,我在app.json文件上要求使用“ sencha-chart”而不是“ ext-chart”,Charts可以正常工作,但是在使用该工具的bar系列上添加工具提示不起作用。 No error logs. 没有错误日志。
I also check their example on sencha chart kitchensink (which chart tooltip is working) found out that they require "ext-chart" for that. 我还在sencha图表kitchensink(该图表工具提示正在工作)上检查了他们的示例,发现它们为此需要“ ext-chart”。 My code for bar series with tooltip config: 我的带有工具提示配置的酒吧系列代码:
series: [{
type: 'bar',
xField: 'name',
yField: ['data1'],
style: {
opacity: 0.80
},
highlight: {
fill: '#000',
'stroke-width': 20,
stroke: '#fff'
},
tips: {
trackMouse: true,
style: 'background: #FFF',
height: 20,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data1') + '%');
}
}
}]
Is there something wrong with my codes? 我的代码有问题吗?
Thanks 谢谢
Your code needs one small change "tips" for EXTjs 5 becomes "tooltip." 您的代码需要进行一些小的更改,“技巧”才能使EXTjs 5变为“工具提示”。
tooltip: {
trackMouse: true,
style: 'background: #FFF',
height: 20,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ': ' + storeItem.get('data1') + '%');
}
}
However, there are a lot of bugs with the EXTjs 5 charts. 但是,EXTjs 5图表存在很多错误。 I had this same issue, and submitted a bug to Sencha: 我遇到了同样的问题,并向Sencha提交了一个错误:
http://www.sencha.com/forum/showthread.php?289313-Sencha-EXTjs-5-Charts-Broken-Tooltips http://www.sencha.com/forum/showthread.php?289313-Sencha-EXTjs-5-Charts-Broken-Tooltips
tooltip: {
trackMouse: true,
style: 'background: #FFF',
height: 20,
renderer: function(storeItem, item) {
this.setHtml(storeItem.get('name') + ': ' + storeItem.get('data1') + '%');
}
}
I used tooltip
inplace of tips
and this.setHtml()
in place of this.setTitle()
,and it worked for me. 我用tooltip
tips
代替tips
,用this.setHtml()
代替this.setTitle()
,它对我this.setTitle()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.