简体   繁体   English

EXTJS 5图表工具提示在require []上使用“ sencha-charts”不起作用

[英]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.

相关问题 使用绑定时Extjs5 itemSelector不起作用 - Extjs5 itemSelector not working when using bind 当我使用表单 (onUpdateClick) 更新有界记录时如何同步我的商店。 我正在使用 Extjs 7.5 (Sencha CMD) - How to sync my Store when I update the bounded record using form (onUpdateClick). I'm using Extjs 7.5 (Sencha CMD) WPF-工具提示:ItemsSource不起作用 - Wpf - Tooltip : ItemsSource not working 在ExtJS中将网格用作字段 - Using grid as field in ExtJS WPF工具提示触发器不起作用 - WPF ToolTip Trigger Not Working 父视图模型存储如何在Sencha Architect ExtJs 5.1中加载并绑定到子网格组件? - How Parent View Model Store Load and bind to child grid component in Sencha Architect ExtJs 5.1? 使用全局声明存储的 ExtJS5 ViewModel - ExtJS5 ViewModel using global declared store 棱镜:声明一些需要某些服务才能工作的视图 - Prism: Declare some Views that require some service to be working XAML验证错误弧线和错误工具提示不使用IDataErrorInfo显示? - xaml validation error rad line and error tooltip not disply using IDataErrorInfo? 如何使用MVVM Light将工具提示错误消息添加到绑定到WPF中int属性的文本框 - How to add tooltip error message to textbox that is bound to int property in WPF using MVVM Light
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM