Home
Analytics
Plotting Month Name in the X-axis in bar chart
Subha Vijayalekshmi
I am facing an issue with sorting the month in a chart. I have to show the month wise statistics in a bar chart. In the dataset,I am sorting by monthid,and when I preview the results,I get the desired output.But issue comes when I need to diplay the month name.The months are getting alphabetically displayed.
How to plot x-axis in a bar chart ,with monthname as 'Jan','Feb','Mar'.... 'Dec',rather than 'Apr','Aug','Dec',...'Sep' in display ?
Find more posts tagged with
Comments
wwilliams
Maybe you should try using the month number to order by?
wwilliams
Sorry duplicate post
Subha Vijayalekshmi
Thanks for the reply. In my dataset,am ordering by month number (Month NUmber is 1 for Jan,2 fro Feb... 12 for dec).But when I create a group with Month_name,using data cube and publishing the data design file to Information Console,the month names are again getting aplhabetically ordered.
ahsiang
Hi, what you can do is within the dataset, define a new calculated month name and use it as an attribute in your cube for the date month. Within the chart, use the attribute to display but sort the field with month id.
wwilliams
I just created a cube and grouped by month. I then opened up the expression builder and for fun added<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (dimension["Group2"]["Month"] == 1){ "JAN"
}
else if(dimension["Group2"]["Month"] == 2) { "FEB"
}
.
.
.</pre>
And it displayed the month name in order Jan-Dec.<br />
Is that what you are looking for?
ahsiang
Here's a sample. I just forgot that my approach of using attribute is only in Actuate BIRT, Open Source BIRT does not allow you to define attribute. In Open Source, you just define the display format to be of the month name within the cube.
Subha Vijayalekshmi
Thanks every one .... The month name ,gets plotted perfectly when display field is month name while the key field is Month id.
When I try to drill down from Year -> Quarter -> Month,Year to Quarter works fine,but when drilling down further to Month, the following issue props up..
"There is non-fatal error. Cause : Unable to use a text data to render a numerical/datetime axis. (Element ID:1996)".
I am using a datadesign file and publishing it in information console.
ahsiang
Which version of Actuate are you using? Are you using the Classic Models? Can you share your .datadesign and .data file?
ahsiang
here's my sample that seems ok. my year can drill to quarter and then to month text
Abdur Rahmaan
<p>Hi </p> <span><a data-ipb='nomediaparse' class="" href='
http://www.birt-exchange.org/forum/index.php?/user/56997-subha-vijayalekshmi/'
title="">Subha Vijayalekshmi</a>,</span><p> Here is the answer for your particular issue, which is very easy and simple. Even I was facing the same issue how to order the month names like Jan feb mar..... dec. select bar chart ,double click it, u wil get edit chart dialog box, click select data tab, in category series drop the monthnames data from ur dataset. By default it takes asc order like april,august,december....Chill. just besides the category series text area, u can see java script synatx button, dont clik it, next to that button u can see <span class='bbc_underline'><strong>edit group and sorting</strong></span> button ,clik it to open and leave data sorting unsorted and deselect the tick from grouping. Now it will work as per month names Jan,Feb,Marc,Apr.....Dec... Try it. Thanks.</p><p><em><span class='bbc_underline'><strong>For developers:</strong></span></em></p><p>And If you don mind, contact me for any of BIRT related issues or any other BI doubts. I am in need of sharing and gaining knowledge.</p><p>Call me@ 08884584649 (India-Bangalore).</p>
vigneshaaum
<p>hi ...</p>
<p> </p>
<p>i want to sort mont-year but i am try sorting in property editor not in use any one help me.i am getting following result</p>
<p> </p>
<p> dec-16 jun-16 sep-16</p>
<p> </p>
<p>3 45 12</p>
<p>4 55 23</p>
<p>4 12 23 im used in my report using computed column for seperate column using javascript</p>