Home
Intelligence (Analytics)
Sort the y -axis
sarath_143
Hi,
I made the bar chart with x axis and y axis and y series grouping. Then i tried to sort the y series for that i changed in edit chart in the y series group to sort, but its not sorting. I changed the query to "order by col" but still not changed. Could you please help me on this?
Find more posts tagged with
Comments
mwilliams
So, you have a specific order you want the x-axis to be in or you want it alphabetical, but it's not working right when you use y-series grouping? Let me know. Sorting is disabled when you do y-series grouping. Depending on what you're doing, I might be able to show a workaround in an example if you let me know on the above question.
sarath_143
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79911" data-time="1310396266" data-date="11 July 2011 - 07:57 AM"><p>
So, you have a specific order you want the x-axis to be in or you want it alphabetical, but it's not working right when you use y-series grouping? Let me know. Sorting is disabled when you do y-series grouping. Depending on what you're doing, I might be able to show a workaround in an example if you let me know on the above question.<br /></p></blockquote>
I want order by y-axis. I am explaining my problem here clearly. I have list of elements, each element have with different types severity(s) (severity means critical/major). One severity occurs more than once.<br />
<br />
<br />
Ex: <br />
<strong class='bbc'>Element</strong> || <strong class='bbc'>Severity</strong> || <strong class='bbc'>count(severity)</strong><br />
xyz || Major || 83<br />
xyz || Critical || 43<br />
abc || Major || 45 <br />
abc || Major || 33<br />
<br />
So in the above example, i want the element on x-axis and count(severity) with group by element, severity on y - axis in descending (severity).<br />
In the result graph, x axis represents element name and y axis on each bar represents all types of severity with count per element.<br />
<p>Here i got result chart but in the descending order, i am getting as random order.</p><br />
<p> I am providing the screenshot </p><br />
Note:I selected the oriented - flip axis in <strong class='bbc'>Edit chart - select chart type</strong>
mwilliams
So, you want to sort by the value? Smallest bar on top to largest bar on bottom? With y-series grouping enabled, the option to sort by the value series is disabled. What is your BIRT version? I'll try a couple things to see if I can get this to work how you want it.
sarath_143
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79984" data-time="1310477347" data-date="12 July 2011 - 06:29 AM"><p>
So, you want to sort by the value? Smallest bar on top to largest bar on bottom? With y-series grouping enabled, the option to sort by the value series is disabled. What is your BIRT version? I'll try a couple things to see if I can get this to work how you want it.<br /></p></blockquote>
Yes, i want to sort by value. largest bar on top, smallest bar on bottom. where have to enable the y-series group, the optoin to sort by the series is disabled ? My birt version is 2.6.
mwilliams
Take a look at this example. Be sure to change the csv file location in the dataSource to where you save it. It's a bit of a hack, but it works. I add a table to the design grouped by element and add a couple aggregations to give me the different values for each group. I use these to sort the chart. I could have used just a single aggregation adding all the values in the group, but I already had it this way for another try that didn't work, so I used the two different ones.
In the chart, I create groupings by adding a new series and picking the rows to use with the value series expression. Note: this will only work if you know your possible categories. There may be a simpler way, but I haven't found it. I tried creating the values and groupings in a table, but I kept getting an exception I didn't find my way around. Hope this helps. Good luck!