刷新拉力图 [英] Refreshing a rallychart

查看:39
本文介绍了刷新拉力图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示图表的 Rally SDK 2.0p5 应用程序.当用户选择一个选项时,数据将被更新,我想刷新图表.但它不会重新绘制,而是会在下方放置一个新图表.正确的语法是什么?

I have a Rally SDK 2.0p5 app that displays a chart. When the user selects an option, the data will be updated and I would like to refresh the chart. But instead of redrawing, it will place a new chart beneath. What is the proper syntax?

                // Configure and Add the chart
                this.add(
                    {
                        xtype: 'rallychart',
                        height: 400,
                        id: 'chart',
                        chartConfig: {
                            chart: {
                            },
                            title: {
                                text: 'My Chart',
                                align: 'center'
                            },
                            xAxis: [
                                {
                                    categories: ['M0','M1','M2','M3','M4','M5'],
                                    title: {
                                        text: 'Interval'
                                    }
                                }
                            ],
                            yAxis: {
                                title: {
                                    text: yText
                                }
                            },
                            series: [ { type: 'column',
                                        name: yText,
                                        data: mCount } ],
                            plotOptions : {
                                column: {
                                    color: '#F00'
                                },
                                series : {
                                    animation : {
                                        duration : 2000,
                                        easing : 'swing'
                                    }
                                }
                            }
                        }
                    }
                );

推荐答案

在添加新图表之前,您需要删除第一个图表.

You need to remove the 1st chart before adding the new one.

redrawChart: function() {
    this.remove('#chart');
    this.add({...});
}

这篇关于刷新拉力图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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