Javascript Firefox和Chrome上的Highcharts渲染器x和y不同
我有一个通过Javascript Firefox和Chrome上的Highcharts渲染器x和y不同,javascript,jquery,google-chrome,firefox,highcharts,Javascript,Jquery,Google Chrome,Firefox,Highcharts,我有一个通过chart.renderer添加了矩形的图形,它看起来和我在Firefox中想要的完全一样,但是当我在Chrome或IE中查看它时,坐标是关闭的。我设置了min和max并且尝试了setInterval,但没有效果。这是我的密码: $('#ao_vs_ppv').highcharts({ chart: { renderTo: 'ao_vs_ppv', type: 'scatter', height:600, width:600 }, titl
chart.renderer
添加了矩形的图形,它看起来和我在Firefox中想要的完全一样,但是当我在Chrome或IE中查看它时,坐标是关闭的。我设置了min
和max
并且尝试了setInterval
,但没有效果。这是我的密码:
$('#ao_vs_ppv').highcharts({
chart: {
renderTo: 'ao_vs_ppv',
type: 'scatter',
height:600,
width:600
},
title: {
text: 'Air Overpressure Vs. Peak Particle Velocity'
},
xAxis: {
min: .01,
max: 10,
type: 'logarithmic',
minorTickInterval:0.1,
title: {
text: "Peak Particle Velocity (in/sec)"
},
labels: {
overflow: 'justify'
},
tickmarkPlacement: 'on',
gridLineWidth: 1,
plotBands: [{
color: '#F7FE2E',
from: .4,
to: 10
},{
color: '#F7FE2E',
from: 1,
to: 10
}]
},
yAxis: {
min: 90,
max: 150,
title: {
text: 'Air Overpressure (dBL)'
},
tickInterval:10,
labels: {
overflow: 'justify'
},
plotBands: [{
color: '#F7FE2E',
from: 120,
to: 150
}]
},
plotOptions: {
scatter: {
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: 'AO: {point.y}dBL<br>PPV: {point.x}in/sec'
}
}
},
legend: {
layout: 'horizontal',
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
series:formatHighChartsScatter(data[i]['x_data'],data[i]['y_data'], seismoNames)
}, function(chart) { // on complete
chart.renderer.rect(348, 50, 242, 217, 0)
.attr({
fill: 'red'
})
.add();
});
$('ao#u vs_ppv')。高图({
图表:{
renderTo:“ao_vs_ppv”,
键入:“散布”,
身高:600,
宽度:600
},
标题:{
文字:“空气超压与峰值粒子速度”
},
xAxis:{
最小:.01,
最高:10,
类型:'对数',
minorTickInterval:0.1,
标题:{
文字:“峰值粒子速度(英寸/秒)”
},
标签:{
溢出:'justify'
},
勾选位置:“on”,
网格线宽度:1,
绘图带:[{
颜色:“#F7FE2E”,
发件人:.4,
收件人:10
},{
颜色:“#F7FE2E”,
发信人:1,,
收件人:10
}]
},
亚克斯:{
最小:90,
最高:150,
标题:{
文本:“空气超压(dBL)”
},
时间间隔:10,
标签:{
溢出:'justify'
},
绘图带:[{
颜色:“#F7FE2E”,
起:120,
收件人:150
}]
},
打印选项:{
散布:{
工具提示:{
headerFormat:“{series.name}
”,
pointFormat:'AO:{point.y}dBL
PPV:{point.x}英寸/秒'
}
}
},
图例:{
布局:“水平”,
边框宽度:1,
背景颜色:“#FFFFFF”,
影子:对
},
系列:FormatHighChartsCatter(数据[i]['x_数据'],数据[i]['y_数据'],地震名称)
},函数(图表){//已完成
chart.renderer.rect(348,50,242,217,0)
艾特先生({
填充:“红色”
})
.add();
});
以下是Firefox中的外观:
以下是Chrome的外观:我相信我已经找到了解决方案。它与chart.plotLeft和chart.plotTop的图表偏移有关。稍后我将发布我的完整解决方案 这是我的工作代码:
$('#ao_vs_ppv').highcharts({
chart: {
renderTo: 'ao_vs_ppv',
type: 'scatter',
height:600,
width:600
},
title: {
text: 'Air Overpressure Vs. Peak Particle Velocity'
},
xAxis: {
min: .01,
max: 10,
type: 'logarithmic',
minorTickInterval:0.1,
title: {
text: "Peak Particle Velocity (in/sec)"
},
labels: {
overflow: 'justify'
},
gridLineWidth: 1,
plotBands: [{
color: '#F7FE2E',
from: .4,
to: 10
},{
color: '#F7FE2E',
from: 1,
to: 10
}]
},
yAxis: {
min: 90,
max: 150,
title: {
text: 'Air Overpressure (dBL)'
},
tickInterval:10,
labels: {
overflow: 'justify'
},
plotBands: [{
color: '#F7FE2E',
from: 120,
to: 150
}]
},
plotOptions: {
scatter: {
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: 'AO: {point.y}dBL<br>PPV: {point.x}in/sec'
}
}
},
legend: {
layout: 'horizontal',
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
series:formatHighChartsScatter(data[i]['x_data'],data[i]['y_data'], seismoNames)
}, function(chart)
{ // on complete
//calculate corrdinates and dimensions based on offsets
var x=279+chart.plotLeft;
var y=chart.plotTop;
var width=chart.plotWidth*.467;
var height=chart.plotHeight*.502;
chart.renderer.rect(x, y, width, height, 0)
.attr({
fill: 'red'
})
.add();
});
$('ao#u vs_ppv')。高图({
图表:{
renderTo:“ao_vs_ppv”,
键入:“散布”,
身高:600,
宽度:600
},
标题:{
文字:“空气超压与峰值粒子速度”
},
xAxis:{
最小:.01,
最高:10,
类型:'对数',
minorTickInterval:0.1,
标题:{
文字:“峰值粒子速度(英寸/秒)”
},
标签:{
溢出:'justify'
},
网格线宽度:1,
绘图带:[{
颜色:“#F7FE2E”,
发件人:.4,
收件人:10
},{
颜色:“#F7FE2E”,
发信人:1,,
收件人:10
}]
},
亚克斯:{
最小:90,
最高:150,
标题:{
文本:“空气超压(dBL)”
},
时间间隔:10,
标签:{
溢出:'justify'
},
绘图带:[{
颜色:“#F7FE2E”,
起:120,
收件人:150
}]
},
打印选项:{
散布:{
工具提示:{
headerFormat:“{series.name}
”,
pointFormat:'AO:{point.y}dBL
PPV:{point.x}英寸/秒'
}
}
},
图例:{
布局:“水平”,
边框宽度:1,
背景颜色:“#FFFFFF”,
影子:对
},
系列:FormatHighChartsCatter(数据[i]['x_数据'],数据[i]['y_数据'],地震名称)
},功能(图表)
{//on完成
//基于偏移计算相关度和尺寸
var x=279+chart.plotLeft;
var y=chart.plotTop;
变量宽度=图表。绘图宽度*.467;
变量高度=图表.绘图高度*.502;
chart.renderer.rect(x,y,宽度,高度,0)
艾特先生({
填充:“红色”
})
.add();
});
ctrl+0已按下