Home
Analytics
how to set x-axis label as fixed in birt report
404040
<p>The data contain of month june,april,july are those value only showing in chart but my condition is set all month fixed if no data show zero value or null value i <span>had tried by to uncheck a is categories its not satisfied my condition so how to </span><span>achieve in chart script</span><span> ?or if any other way could please provide some script or example to understand the process....</span></p><p> </p><p> </p><p><span>thank in advance</span></p>
Find more posts tagged with
Comments
kclark
<p>Are you wanting to hide the x axis title if no data is returned for you chart?</p>
404040
<p>Thank for reply ....wt am trying to say is i have to fix label as constant in script on chart....because if i manually tried by UI i cant able to fix constant for all month ..let us consider a example am having data in databases for the month of june and july this two month only showing in chart when i drop date filed in Category X-axis ...so my need is to show all month constant like jan,feb,mar,april,may,june,july,aug,sep,oct,nov,dec for that i have to customize some script ..</p><p> </p><p> </p><p> </p><p> </p><p>thank u in advance </p>
BRM
<p>I think what you are saying is that your dataset looks like this</p><p> </p><p>Jan 20</p><p>Feb 16</p><p>Apr 21</p><p>Jun 35</p><p> </p><p>And what you want to display on a chart is </p><p> </p><p>Jan 20</p><p>Feb 16</p><p>Mar 0</p><p>Apr 21</p><p>May 0</p><p>Jun 35</p><p> </p><p>And the chart is not displaying Mar or May because no data is returned.</p><p> </p><p>If I have this right then there are probably a lot of other ways but I usually do that in SQL like this (if you are using SQL to return the dataset that is...)</p><p> </p><div>SELECT m.mnth AS mo</div><div> , COUNT(*) </div><div>FROM myTable WC</div><div> RIGHT OUTER JOIN ((SELECT 'Jan' AS mnth)</div><div> UNION ALL (SELECT 'Feb' AS mnth)</div><div> UNION ALL (SELECT 'Mar' AS mnth)</div><div> UNION ALL (SELECT 'Apr' AS mnth)</div><div> UNION ALL (SELECT 'May' AS mnth)</div><div> UNION ALL (SELECT 'Jun' AS mnth)) m</div><div> ON LEFT(MONTHNAME(WC.CGIIDATE),3) = m.mnth</div><div>GROUP BY 1</div><p> </p><p>Essentially you build a table with all the months you want and then join the data you want to it.</p><p> </p><p>You can make the months dynamic with the date_sub function.</p><p> </p><p>If this does not work for you then you could have a look in the chart wizard for a setting that displays the x-axis data ans see if there is a setting for the aggregation interval and set it to display groups with no data. In that case your x-axis would have to be interpretable as a date value which it is not in my little example.</p><p> </p><p>Other may have better ways of doing this. I don't claim this is the preferred method for this. Only that it works for me.</p><p> </p><p>Hope that helps.</p>
kclark
<p>Here's an example from an old devshare too.</p>
404040
<p>thank u very much..its working as my excepted....</p>