Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Highcharts 将项目重绘到highstock时滚动条预览消失_Highcharts_Highstock - Fatal编程技术网

Highcharts 将项目重绘到highstock时滚动条预览消失

Highcharts 将项目重绘到highstock时滚动条预览消失,highcharts,highstock,Highcharts,Highstock,我用的是highsoft的highstock(http://highslide.com/). 我试图允许用户更改图表类型(样条线、直线、面积样条线等)。我通过重置选项、从系列中弹出项目并将它们重新添加到系列中来实现这一点。除了重新添加所有内容时滚动条预览消失外,它工作正常。任何帮助都将不胜感激。这是我的密码: createChart: function(seriesOptions){ var cmp = this; var chart_ty

我用的是highsoft的highstock(http://highslide.com/).

我试图允许用户更改图表类型(样条线、直线、面积样条线等)。我通过重置选项、从系列中弹出项目并将它们重新添加到系列中来实现这一点。除了重新添加所有内容时滚动条预览消失外,它工作正常。任何帮助都将不胜感激。这是我的密码:

    createChart: function(seriesOptions){
        var cmp        = this;
        var chart_type = this.collection.chart_type;
        if(!chart_type){
            chart_type="line";
        }   
        if(!cmp.chart){
            var options = { 
                chart: {
                    renderTo: 'preview',
                    type: chart_type,
                    zoomType: 'x' 
                },  

                rangeSelector: {
                    selected: 4
                },  
                plotOptions: {
                    series: {
                        point: {
                            events: {
                                click: function() {
                                    console.log(this.config[0]);
                                }   
                            }   
                        }   
                    }   
                },  
                tooltip: {
                    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',
                    yDecimals: 2
                },  
                series: seriesOptions
            };  
            cmp.chart = new Highcharts.StockChart(options);
        }else{
            while(cmp.chart.series.length>0){
                cmp.chart.series[0].remove();
            }   
            if(cmp.collection.compare_type=='percent'){
                cmp.chart.options.plotOptions.series.compare = 'percent';
                cmp.chart.options.tooltip.pointFormat = '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>';
            }else{
                cmp.chart.options.plotOptions.series.compare = undefined;
                cmp.chart.options.tooltip.pointFormat = '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>';
            }   

           _.each(seriesOptions, function(option){
               option.type = cmp.collection.chart_type;
               cmp.chart.addSeries(option, true, false);
           }); 
            cmp.chart.redraw();
           //window.chart = cmp.chart;
        }   
    },  
createChart:函数(系列选项){
var cmp=此;
var chart\u type=this.collection.chart\u type;
如果(!图表类型){
chart_type=“line”;
}   
如果(!cmp.chart){
变量选项={
图表:{
renderTo:“预览”,
类型:图表类型,
zoomType:'x'
},  
范围选择器:{
选定:4
},  
打印选项:{
系列:{
要点:{
活动:{
单击:函数(){
console.log(this.config[0]);
}   
}   
}   
}   
},  
工具提示:{
pointFormat:“{series.name}:{point.y}({point.change}%)
”, 样本:2 }, 系列:系列选项 }; cmp.chart=新的Highcharts.StockChart(选项); }否则{ 而(cmp.chart.series.length>0){ cmp.chart.series[0]。删除(); } if(cmp.collection.compare_type=='percent'){ cmp.chart.options.plotOptions.series.compare='percent'; cmp.chart.options.tooltip.pointFormat='{series.name}:{point.y}({point.change}%)
; }否则{ cmp.chart.options.plotOptions.series.compare=未定义; cmp.chart.options.tooltip.pointFormat='{series.name}:{point.y}
'; } _.每个(系列选项、功能(选项){ option.type=cmp.collection.chart\u type; cmp.chart.addSeries(选项,真,假); }); cmp.chart.redraw(); //window.chart=cmp.chart; } },
好的,我想好了

我意识到“navigator”成为系列项目之一,我在while循环中删除了它。所以现在我只需要弹出系列中所有名称不是“navigator”的项目