Javascript 向时间序列图添加动态平均值
我会尽可能准确地解释我的问题。我正在寻找满足以下两个条件的javascript图表库:Javascript 向时间序列图添加动态平均值,javascript,charts,highcharts,highstock,Javascript,Charts,Highcharts,Highstock,我会尽可能准确地解释我的问题。我正在寻找满足以下两个条件的javascript图表库: From an ajax request retrieving time series, display dynamically data when changing the time window. 例如,它是完美的高股票: 和 plot an horizontal line corresponding to the mean, changing when the user update the ti
From an ajax request retrieving time series,
display dynamically data when changing the time window.
例如,它是完美的高股票:
和
plot an horizontal line corresponding to the mean,
changing when the user update the time window on the chart.
实际上,可以显示一条水平线。但它们在整个数据上是固定的,并且在修改时间窗口时不会相应改变:
我对这个话题很陌生,想知道修改Highstock类是否有可能产生这样的结果。或者可能存在其他一些
js
库?使用以下答案:
afterSetExtremes
事件将此示例放在一起,如下所示:
xAxis : {
events:{
afterSetExtremes:function() {
var ext = this.getExtremes();
getAverage(this.chart, ext.min, ext.max, show, width, avgColor, dashStyle);
}
}
},
此处的工作示例:
它可以很容易地使用根据需要添加/删除的绘图线,而不是一个系列,但我喜欢将其作为一个系列,这样它就有一个图例条目。使用以下答案的组合:
afterSetExtremes
事件将此示例放在一起,如下所示:
xAxis : {
events:{
afterSetExtremes:function() {
var ext = this.getExtremes();
getAverage(this.chart, ext.min, ext.max, show, width, avgColor, dashStyle);
}
}
},
此处的工作示例:
它可以很容易地使用根据需要添加/删除的绘图线,而不是一个系列,但我喜欢将其作为一个系列,这样它就有一个图例条目。谢谢您的回答!我现在要消化它。。。会让你不断更新!你是一个高明的老板!我将尝试调整它,使其与Highstock一起工作。谢谢你的帮助和+1!NP我不太喜欢Highstock,但我认为不需要花太多的精力来让它保持同样的效果。谢谢你的回答!我现在要消化它。。。会让你不断更新!你是一个高明的老板!我将尝试调整它,使其与Highstock一起工作。谢谢你的帮助和+1!NP我在Highstock公司工作不多,但我认为不应该花太多的精力使它也能工作。