我正在使用图表来可视化数据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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)