gpt4 book ai didi

rally - 使用 App SDK 2.0 中的新数据更新图表

转载 作者:行者123 更新时间:2023-12-01 01:07:09 25 4
gpt4 key购买 nike

我正在使用图表来可视化 TimeboxScopedApp 中的数据,我想在范围改变时更新数据。使用 remove() 的更暴力方法然后按照说明重新绘制图表 here给我留下了一个叠加的“正在加载...”面具,但其他方式有效。使用 Highchart 原生的自然方法 redraw()方法是我的偏好,只是我不知道如何访问实际的 Highchart 对象而不是 App SDK 包装器。

这是代码的相关部分:

var chart = Ext.getCmp('componentQualityChart');
if (chart) {
var chartCfg = chart.getChartConfig();
chartCfg.xAxis.categories = components;
chart.setChartConfig(chartCfg);
chart.setChartData(data);
chart.redraw(); // this doesn't work with the wrapper object
} else { // draw chart for the first time

如何使用新数据重新绘制图表?

最佳答案

假设图表 (componentQualityChart) 是 Rally.ui.chart.Chart 的一个实例,您可以像这样访问 HighCharts 实例:

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

关于rally - 使用 App SDK 2.0 中的新数据更新图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17888880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com