道场图表 - Y轴标题在很长时间内被切断

时间:2013-12-13 09:14:29

标签: javascript charts dojo dojox.charting

当DOJO图表中Y轴的标题是长字符串时,则不显示完整字符串。是否有任何截断标题的选项(支持截断标签)并在“鼠标悬停”事件的工具提示中显示完整标题字符串?

例如,y轴标题字符串是“这是dojo图表中y轴标题的非常非常长的字符串”。只显示部分字符串。

注意:图表div的大小不能增加。

http://jsfiddle.net/nagarajs92/CdDaD/1/

<script>
dojo.require("dojox.charting.Chart2D");

dojo.require("dojox.charting.themes.Tom");

// Define the data
var chartData = [10000,9200,11811,12000,7662,13887,14200,12222,12000,10009];

// When the DOM is ready and resources are loaded...
dojo.ready(function() {
var chart = new dojox.charting.Chart2D("chartNode");

chart.addPlot("default", {
    type: "Lines",
    markers: true
});

// Add axes
chart.addAxis("x");
chart.addAxis("y", { min: 5000, max: 15000, vertical: true, fixLower: "major",  
 fixUpper: "major", title: "this is a very very very long string for y axis title in 
 dojo charts" });

// Add the series of data
chart.addSeries("SalesThisDecade",chartData);

// Render the chart!
chart.render();

});
</script>
<div id="chartNode" style="width:600px;height:300px;"></div>

0 个答案:

没有答案