#15796 closed defect (invalid)
missing axis labels in dojo1.8 bar chart
Reported by: | airplanepeanuts | Owned by: | cjolif |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Charting | Version: | 1.8.0rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The following example works against dojo1.7.2. If dojo1.8 is plugged in only every other custom label is visible:
<!DOCTYPE HTML> <html lang="en">
<head>
<meta charset="utf-8"> <title>Demo: Monthly Sales</title> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/claro/claro.css" media="screen"> <!-- load dojo and provide config via data attribute --> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"
data-dojo-config="async: true">
</script> <script> require(["dojox/charting/Chart","dojox/charting/themes/MiamiNice","dojox/charting/plot2d/Bars","dojox/charting/plot2d/Markers","dojox/charting/axis2d/Default","dojo/domReady!" ], function(Chart, theme) {
var chartData = [10000,9200,11811,12000,7662,13887,14200,12222,12000,10009,11288,12099]; var chart = new Chart("chartNode"); chart.setTheme(theme); chart.addPlot("default", {
type: "Bars", maxBarSize: 18, gap: 2
}); chart.addAxis("x", { font: "normal normal normal 20pt Arial", includeZero: true, minorTicks: false, microTicks: false, majorTicks: true, majorTickStep:1, fixed: true,fontColor: "red", vertical: true,labels:[{value:1, text:"Hallo"},{value:2, text:"Hallo"},{value:3, text:"Hallo"},{value:4, text:"Hallo"}]}); chart.addAxis("y", { fixLower: "major", fixUpper: "major", font: "normal normal normal 25pt Arial", fontColor: "red" }); chart.addSeries("Monthly Sales",chartData); chart.render();
});
</script>
</head> <body>
<h1>Demo: Columns - Monthly Sales</h1>
<div id="chartNode" style="width:800px;height:400px;"></div>
</body>
</html>
Change History (3)
comment:1 Changed 8 years ago by
Component: | Dojox → Charting |
---|---|
Owner: | changed from Adam Peller to cjolif |
Status: | new → assigned |
comment:2 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
If I run your app in 1.7 I see the labels stepping on each other. In 1.8 we introduced the dropLabels mode that get rid of superfluous labels thus the behavior your see. This is stated in the release notes: http://livedocs.dojotoolkit.org/releasenotes/1.8#dojox-charting.
To get back to 1.7 behavior:
1/ set dropLabels: false on your axis 2/ set minorLabels: false on your axis
Please re-open if that does not solve your issue.