Updating a chart with new data in App SDK 2.0

前端 未结 2 644
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 10:04

I am using a chart to visualize data in a TimeboxScopedApp, and I want to update the data when scope changes. The more brute-force approach of using remov

相关标签:
2条回答
  • 2021-01-19 10:30

    Using _unmask() removes the overlaid "Loading.." mask

    if (this.down('#myChart')) {
        this.remove('myChart');
    }
     this.add(
                        {
                            xtype: 'rallychart',
                            height: 400,
                            itemId: 'myChart',
                            chartConfig: {
                                //....
                            },            
                            chartData: {
                                categories: scheduleStateGroups, 
                                series: [ 
                                    {   
                                        //...
                                    }
                                ]
                            }
                        }
                    );
            this.down('#myChart')._unmask();
    
    0 讨论(0)
  • 2021-01-19 10:34

    Assuming chart (componentQualityChart) is an instance of Rally.ui.chart.Chart, you can access the HighCharts instance like this:

    var highcharts = chart.down('highchart').chart;
    
    // Now you have access to the normal highcharts interface, so
    // you could change the xAxis
    highcharts.xAxis[0].setCategories([...], true);
    
    // Or you could change the series data
    highcharts.series[0].data.push({ ... });  //Add a new data point
    
    // Or pretty much anything else highcharts lets you do
    
    0 讨论(0)
提交回复
热议问题