Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/449.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.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
Javascript Angularjs highchart不';不要在IE和SAFARI中显示_Javascript_Angularjs_Highcharts_Safari - Fatal编程技术网

Javascript Angularjs highchart不';不要在IE和SAFARI中显示

Javascript Angularjs highchart不';不要在IE和SAFARI中显示,javascript,angularjs,highcharts,safari,Javascript,Angularjs,Highcharts,Safari,highchart在IE和SAFARI中不显示。我尝试了官方highchart论坛的解决方案,但没有任何帮助(删除“,”在json末尾,或在加载时调整页面大小等…) 我有多个不同的海图,但这里只有一个解释。我调用配置函数取决于图表数据。我的应用程序有很多不同的部分,很难让它工作。Thnx 这是我的密码 function getBaseChartConfig(graphName) { Highcharts.setOptions({ globa

highchart在IE和SAFARI中不显示。我尝试了官方highchart论坛的解决方案,但没有任何帮助(删除“,”在json末尾,或在加载时调整页面大小等…) 我有多个不同的海图,但这里只有一个解释。我调用配置函数取决于图表数据。我的应用程序有很多不同的部分,很难让它工作。Thnx

这是我的密码

function getBaseChartConfig(graphName) {
            Highcharts.setOptions({
                global: {
                    useUTC: false
                }
            });
            var config =
                    {
                        xAxis: {
                            ordinal: false
                        },
                        yAxis: {
                        },
                        options: {
                            chart: {
                                zoomType: 'x',
                                backgroundColor: 'rgba(255, 255, 255, 1)',
                                polar: true,
                                type: 'line',
                                borderRadius: 5

                            },
                            legend: {
                                enabled: true
                            },
                            rangeSelector: {
                                //za postavit rucni upis date range-a
                                enabled: false,
                                inputStyle: {
                                    color: 'black'
                                }
                            },
                            navigator: {
                                enabled: true
                            }
                        },
                        series: [],
                        title: {
                            text: graphName
                        },
                        useHighStocks: true
                    };
            return config;
        };
$scope.data.push(solar_voltage);
            $scope.data.push(battery_voltage);
            $scope.data.push(solar_current);
            $scope.data.push(hybridCurrent);
            $scope.chartConfig1 = getChartConfigWithYaxisPlotLines('Production');
            $scope.chartConfig1.series.push({
                id: 1,
                name: "Solar voltage",
                data: $scope.data[0],
                tooltip: {
                    valueDecimals: 2
                }
            }, {
                id: 2,
                name: "Battery voltage",
                data: $scope.data[1],
                tooltip: {
                    valueDecimals: 2
                }
            }, {
                id: 3,
                name: "Solar current",
                data: $scope.data[2],
                tooltip: {
                    valueDecimals: 2
                }
            }, {
                id: 4,
                name: "Hybrid current",
                data: $scope.data[3],
                tooltip: {
                    valueDecimals: 2
                }
            }
            );
 function getChartConfigWithYaxisPlotLines(graphName) {
            var baseChartConfig = getBaseChartConfig(graphName);
            baseChartConfig.yAxis.plotLines = [{
                    color: '#FF0000',
                    width: 1,
                    value: 11.50,
                    label: {text: '11.50'}
                }];
            return baseChartConfig;
        }
下面是这张照片在safari或IE中的外观

这是在CHROME和FIREFOX中

这是来自api的json

能否粘贴$scope.data[0]?我认为您的问题是x值(日期)不正确。Highstock使用以毫秒为单位的时间戳,但您的值类似于“2017-07-03 09:30:03”。在Chrome中,它将被正确解析为日期,但在Safari中,它将抛出一个错误(无效日期)。正确的格式与Date.parse()的格式相同。因此,解决方案应该是解析字符串以更正日期-时间戳。Thnx@morganfree,我将在我返回办公室时尝试您的解决方案。@morganfree这是$scope.data[0]0:149682240000 1:3.7长度:2