Dojo 如何在一张图表中调整多个轴的位置?
我使用dojo创建了一个折线图。最近,我在图表上应用了多轴。但这里有个问题。它应用于一个位置的多个轴,我提出了重叠刻度值的问题。并且不要改变leftBottom的属性,有没有办法调整轴的位置?例如,x:10,y:20 我的代码Dojo 如何在一张图表中调整多个轴的位置?,dojo,dojox.charting,Dojo,Dojox.charting,我使用dojo创建了一个折线图。最近,我在图表上应用了多轴。但这里有个问题。它应用于一个位置的多个轴,我提出了重叠刻度值的问题。并且不要改变leftBottom的属性,有没有办法调整轴的位置?例如,x:10,y:20 我的代码 var axisXRef = {labels : labelsample, titleOrientation : "away", stroke : {}, natural : true}; var axisYRef = {vertical : true, stroke
var axisXRef = {labels : labelsample, titleOrientation : "away", stroke : {}, natural : true};
var axisYRef = {vertical : true, stroke : {}};
var chart = new Chart("chartNode");
chart.addPlot("lines", { type: Lines, tension: 3 ,min:0});
chart.addPlot("stacklines", { type: StackedLines, tension: 3 ,hAxis:"x",vAxis:"y1"});
chart.addPlot("areas", { type: Areas, tension: 3,hAxis:"x",vAxis:"y2" });
chart.custom.axisX = lang.clone(axisXRef);
chart.custom.axisY = lang.clone(axisYRef);
chart.addAxis("x", chart.custom.axisX);
chart.addAxis("y", chart.custom.axisY);
chart.addAxis("y1", {
vertical: true,
min : 50,
max:70,
leftBottom:true,
majorLabels: true, majorTicks: true, majorTick: {color:"red",length:50},
minorLabels: true, minorTicks:true, minorTick:{color:"red",length:50},
microTicks: true, microTick:{color:"red",length:50},
fixUpper: "major",
fixLower:"minor"
});
chart.addAxis("y2", {
vertical: true,
min : 0,
max:49,
leftBottom:true,
majorLabels: true, majorTicks: true, majorTick: {color:"blue",length:25},
minorLabels: true, minorTicks:true, minorTick:{color:"blue",length:25},
microTicks: true, microTick:{color:"blue",length:25},
fixUpper: "major",
fixLower:"minor"
});
不幸的是,Dojo图表只支持每个方向的两个轴,两个轴位于图表的不同一侧。换句话说,图表的左侧不能同时有两个轴。您必须使用leftBottom:false属性来设置一个右侧