0

I have followed your advice, however once hidden, the chart won’t show up when the check box has been unchecked. Here is my code:

                   var charta=document.getElementById("Chart_A").value;
                    var containter = $("#ChartA_Container").swidget();
                    containter.destroy();                            
                    if (Chart_A.checked == false){
                    $("#ChartA_Container").shieldChart(
                        {
                            seriesSettings: {
                                line: {
                                    applyAnimation: {
                                        duration: 0
                                    },
                                    pointMark:{
                                        enabled: false
                                    }
                                }
                            },
                            tooltipSettings: {
                                enabled: false
                            },
                            exportOptions:
                            {
                                image: false,
                                print: false
                            },

                            axisX: {
                                min: 0,
                                max: 55
                            },

                            primaryHeader: {
                                text: "EUR/USD"
                            },
                            dataSeries: [
                                {
                                    seriesType: 'line',
                                    collectionAlias: 'EUR/USD',
                                    data: EURUSD,
                                }
                            ]
                        }
                        )
                    }else{
                        document.getElementById("EURUSDChart").innerHTML="Chart Hidden"
                    };

I will appreciate some more detailed help on this matter.

4

1 回答 1

1

问题很简单。容器.destroy(); 语句用于取消设置图表的容器。一旦完成,就没有容器可以在下次调用函数时取消设置。您需要将此语句放在复选框子句中,这样如果被破坏,它会立即重新创建:

if (Chart_A.checked == false){
 var containter = $("#ChartA_Container").swidget();
 containter.destroy();   
于 2013-08-13T16:04:47.850 回答