我有一个图形/绘图区域,如下所示:
如您所见,网格线不是等距的。
以下是绘制刻度线和网格线的代码。由于比例是对数的,我发现以下应该是一种方便的转换方法。
function setUpflot(){
// setup plot
myTestArray = getRandomData();
var options = {
// series : { shadowSize: 0, splines: {show:true,lineWidth:1}},
series : { },
xaxis : { tickLength:0, show: false },
yaxis :{
//position: "left",
ticks: [[55,""],[68.75,""],[82.5,""],[96.25,""],[110,"110"],
[136.25,""],[165,""],[192.5,""],[220,"220"],[275,""],[330,""],
[385,""],[440,"440"],[550,""],[660,""],[770,""],[880,""]],
transform:function(v){return Math.log(v*1.44);},
tickColor:"rgba(148,129,151,0.5)",
min: minGraphY, max:maxGraphY,show: true
},
y2axis :{
//position: "right",
ticks: [[55,""],[68.75,""],[82.5,""],[96.25,""],[110,"A2"],
[136.25,""],[165,""],[192.5,""],[220,"A3"],[275,""],[330,""],
[385,""],[440,"A4"],[550,""],[660,""],[770,""],[880,""]],
alignTicksWithAxis: true,
transform:function(v){return Math.log(v*1.44);},
tickColor:"rgba(148,129,151,0.5)",
min: minGraphY,
max:maxGraphY,
show: true,
tickLength: 0
},
grid : {
borderWidth:0,
backgroundColor:
{
colors: ["#5d0d3f","#5d0d3f","#5d0d3f",
"#6e0326","#724922","#724922",
"#2a5631","#724922","#724922","#6e0326",
"#5d0d3f","#5d0d3f","#5d0d3f"]
}
}
};
我需要网格线等距。我将如何实现这一目标?
谢谢。