当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - spline chart not working in firefox

问题描述:

created a spilne chart based on date filter and user id filter.

it is perfectly working on chrome version 51 and not visible when i open it in firefox 47.

this is how i am calculating date.

var scheduledate;

var period="Period";

function zeroPadValue(value) {

if (value < 10) {

value = "0" + value;

}

return value;

}

var d = new Date();

var dd = zeroPadValue(d.getDate());

var mm = zeroPadValue(d.getMonth()+1);

var yy = zeroPadValue(d.getFullYear());

scheduledate = yy+"-"+mm+"-"+dd+" - "+yy+"-"+mm+"-"+dd;

and this is the code for spline chart

$(function () {

var chart;

//alert(scheduledate);

var url="getNotificationChart2?bl_subs_id="+subsid+"&createdDateTime="+scheduledate;

console.log(url);

// var url="http://localhost/clients/chart/abcd.json";

$.getJSON(url, function(json1) {

chart = new Highcharts.Chart({

chart: {

renderTo: 'container1',

type: 'spline',

marginRight: 130,

zoomType: 'x'

},

title: {

text: 'Push Report',

x: -20 //center

},

credits: {

enabled: false

},

subtitle: {

text: '',

x: -20

},

plotOptions: {

series: {

dataLabels: {

enabled: true

}

}

},

xAxis: {

title: {

text: period

},

type: 'datetime',

categories: json1[0].value

},

yAxis: {

title: {

text: 'Notification Counts'

},

gridLineWidth: 0,

plotLines: [{

value: 0,

width: 1,

color: '#808080'

}]

},

tooltip: {

formatter: function() {

return '<b>'+ this.series.name +'</b><br/>'+

this.y;

}

},

legend: {

layout: 'horizontal',

align: 'center',

verticalAlign: 'bottom',

x: -20,

y: -30,

borderWidth: 1

},

series: json1

});

});

});

this is working fine on chrome but not in firefox.

i tried to use this Date.UTC(year, month, day, hour, minute, second)

but after that chart is not visible in chrome also.

分享给朋友:
您可能感兴趣的文章:
随机阅读: