当“旋转”时,轴的标题会受到影响。使用 - dojo-charts
我已经给出了 'rotation:-90' 来使 x 轴的标签旋转。 但这种旋转甚至也适用于轴的标题。 我怎样才能阻止呢?请任何人帮助我。 下面是我正在使用的代码..
makeCharts = function() {
var chart1 = new dojox.charting.Chart2D("simplechart", {
title: "Production(Quantity)",
titlePos: "top",
titleGap: 5,
titleFont: "normal normal normal 15pt Arial",
titleFontColor: "orange"
});
chart1.addPlot("default",{type:"ClusteredColumns",
gap: 5,
animate:{duration: 500} })
chart1.addSeries("2008", [113.1,72.1,62.6,59.8,59.3,53.7,52.4,49.1,43.7,40.9], {fill: "#DDFEDC"});
chart1.addSeries("2007",[113.6,65.0,59.2,56.4,62.8,53.5,47.6,44.9,41.5,39.1], {fill: "#FCDEFD"});
chart1.addAxis("x", {
title:'x-axis title comes here',
includeZero: false,
labels:[
{value:1, text:'one'},
{value:2, text:'two'},
{value:3, text:'three'},
{value:4, text:'four'},
{value:5, text:'five'},
{value:6, text:'six'},
{value:7, text:'seven'},
{value:8, text:'eight'},
{value:9, text:'nine'},
{value:10, text:'ten'}
],
rotation:-90
}
);
chart1.addAxis("y", {
vertical: true,
includeZero: true,
from:0,
to:200,
minorTickStep:20}
);
var anim4b = new dojox.charting.action2d.Tooltip(chart1, 'default');
chart1.render();
new dojox.charting.widget.Legend({chart:chart1, horizontal: true}, "legend");
};
dojo.addOnLoad(makeCharts);
I have given 'rotation:-90' to make the lables of x-axis to rotate.
But that rotation is even applied for the title of the axis also.
How can I stop that? Please anyone help me.
Below is the code I'm using..
makeCharts = function() {
var chart1 = new dojox.charting.Chart2D("simplechart", {
title: "Production(Quantity)",
titlePos: "top",
titleGap: 5,
titleFont: "normal normal normal 15pt Arial",
titleFontColor: "orange"
});
chart1.addPlot("default",{type:"ClusteredColumns",
gap: 5,
animate:{duration: 500} })
chart1.addSeries("2008", [113.1,72.1,62.6,59.8,59.3,53.7,52.4,49.1,43.7,40.9], {fill: "#DDFEDC"});
chart1.addSeries("2007",[113.6,65.0,59.2,56.4,62.8,53.5,47.6,44.9,41.5,39.1], {fill: "#FCDEFD"});
chart1.addAxis("x", {
title:'x-axis title comes here',
includeZero: false,
labels:[
{value:1, text:'one'},
{value:2, text:'two'},
{value:3, text:'three'},
{value:4, text:'four'},
{value:5, text:'five'},
{value:6, text:'six'},
{value:7, text:'seven'},
{value:8, text:'eight'},
{value:9, text:'nine'},
{value:10, text:'ten'}
],
rotation:-90
}
);
chart1.addAxis("y", {
vertical: true,
includeZero: true,
from:0,
to:200,
minorTickStep:20}
);
var anim4b = new dojox.charting.action2d.Tooltip(chart1, 'default');
chart1.render();
new dojox.charting.widget.Legend({chart:chart1, horizontal: true}, "legend");
};
dojo.addOnLoad(makeCharts);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚遇到了与您类似的问题,并偶然发现了一种比您上面提出的稍微简单的解决方案。
来自 http://dojotoolkit.org/reference-guide/dojox/charting .html#axis-title:
我发现通过将
titleOrientation: "away"
添加到 x 轴参数,这将覆盖现有的rotation
参数,从而解决问题。仅供参考: 类似问题
I have just encountered a similar problem as you and stumbled across a slightly easier solution to the one you proposed above.
From http://dojotoolkit.org/reference-guide/dojox/charting.html#axis-title:
I found that by adding
titleOrientation: "away"
to the x axis parameters this will override the existingrotation
parameter and thus solves the problem.FYI: Similar question
我得到了这个问题的解决方案...
代码
这是可以称为的
——
苏里亚帕万
I got the solution for this issue...
here is the code
it can be called as
--
SuryaPavan