是否可以删除highstock / highcharts中的窗格? [英] Is it possible to remove a pane in highstock/highcharts?

查看:97
本文介绍了是否可以删除highstock / highcharts中的窗格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的highstock中有两个窗格,我可以动态删除其中一个窗格。所以,如果我点击一个窗格,我应该能够将事件与窗格的id(yaXis)一起捕获,并随后删除与其系列相关的轴。
我已经像下面这样动态地添加了窗格(所以我的轴有Id等)

  chartX.addAxis ({// Secondary yAxis 
id:studyName,
title:{
text:studyText
},
isX:false,
lineWidth:2,
lineColor:'#08F',
//对面:true,
top:startHeight,$ b $ height:100,
offset:0
}) ;
var chartToUpdate = chartX.addSeries({
name:'ADBE',
id:'studyNew',
color:'black',
data:studyData,
yAxis:studyName
});
$(#selectStudy)。append(< option value ='+ countNoOfStudiesAdded +'>+ studyName +< / option>)
}

是否有可能如上所述删除窗格。任何其他方法,可以帮助实现动态删除窗格将不胜感激。



谢谢。

解决方案

您可以使用Axis.remove()函数删除轴。



http:// api。 highcharts.com/highcharts#Axis.remove()


Suppose I have two panes in my highstock, can I remove one of the panes dynamically. So if I click on a pane, I should be able to trap the event alongwith the id of the pane(yaXis) and subsequently delete the axis alongwith its series. I have added the panes dynamically like following( so I axis have Id etc. with me)

chartX.addAxis({ // Secondary yAxis
                    id: studyName,
                    title: {
                        text: studyText
                    },
                    isX: false,
                    lineWidth: 2,
                    lineColor: '#08F',
                    //opposite: true,
                    top: startHeight,
                    height: 100,
                    offset: 0
                });
                var chartToUpdate=chartX.addSeries({
                        name: 'ADBE',
                        id: 'studyNew',
                        color: 'black',
                        data: studyData,
                        yAxis: studyName
                    });
                    $("#selectStudy").append("<option value='"+countNoOfStudiesAdded+"'>"+studyName+"</option>")
                }

Is it possible to delete the pane as mentioned above. Any other method that can help achieve dynamic removal of the pane will be appreciated.

Thanks.

解决方案

You can use Axis.remove() function to remove axis.

http://api.highcharts.com/highcharts#Axis.remove()

这篇关于是否可以删除highstock / highcharts中的窗格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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