Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Sort chart with a different column
vash
Hi,
I am using Birt 2.3.2
I have a chart in my report - with one Y series and X series.
The optional Y series grouping is also set.
I want to sort the x series and even the optional Y series with different columns.
Since the Y series grouping is set - the sorting in X series - allows me to select the sort direction but the 'sort on' block is locked out - it does not let me select anything.
Similarly - on y series grouping - it lets me sort on the column which is used for grouping - but no other column.
Is it possible to sort both of these (x series and y series grouping) with different columns??
Thanks,
Vash
Find more posts tagged with
Comments
mwilliams
Hi Vash,
If it's grayed out, it must not be supported in 2.3.2. I'll check in newer versions to see if anything is different. You might try sorting your dataSet in the order you want it before putting sending the data to the chart to see if it changes anything for you.
vash
Michael,
Yes, its grayed out.
I even tried looking at 2.5 - but its grayed out there too.
About your suggestion - to sort the dataset before charting - well I want to sort the x-axis as well as the y-series grouping.
How do i sort the dataset in this case?
mwilliams
Hmmm. Maybe if you did your grouping and sorting in a table, put the chart in the footer of the table and used the "container" as the dataSet rather than binding the chart directly to the dataSet, you could use the grouping and sorting that is on the table already for your chart.
I'll check 2.6.1 to see if there are any changes on this in the most recent version. You can always file an enhancement request to be able to sort your groupings by another column value rather than just the grouping column, if it's not different in 2.6.1.
vash
Ok, please, let me know if its any different in 2.6.
Otherwise for now, I will use the approach you mentioned - about using the table as source for the chart.
Thanks,
Vash.
mwilliams
Vash,
In 2.6.1, if you include optional y-series grouping, you can choose what you want to sort the optional grouping by or use the expression builder to decide, but not another field to sort the x-axis by. It only has the choice of asc and desc.
If you're looking to sort the x-axis by another field in this situation, you might just request an enhancement for this type of sorting feature.
http://www.birt-exchange.org/org/resources/bug-reporting/
vash
Ok,
Thank you so much for looking into this.
I will file an enhancement request.
I have another ques about crosstab.
I am using a crosstab and for each column i want to set a background color for the min and max value.
Can you please guide me - how can this be done using scripting?
Thanks,
Vash
vash
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327253
- Sorting the x-axis in chart using a different field when optional y-series grouping is used.
mwilliams
Thanks for the update!
vash
<blockquote class='ipsBlockquote' data-author="'vash'" data-cid="69139" data-time="1286465575" data-date="07 October 2010 - 08:32 AM"><p>
Ok,<br />
<br />
Thank you so much for looking into this.<br />
<br />
I will file an enhancement request.<br />
<br />
I have another ques about crosstab.<br />
I am using a crosstab and for each column i want to set a background color for the min and max value.<br />
Can you please guide me - how can this be done using scripting?<br />
<br />
Thanks,<br />
Vash<br /></p></blockquote>
<br />
<br />
Can you please comment on this one.
mwilliams
Are you still using 2.3.2? Or have you upgraded? I'll try something in whatever version you're currently using.
vash
Yes, still on 2.3.2
Thanks,
Vash.
mwilliams
Take a look at this design. It doesn't work in preview, but it works in the web viewer mode when the run and render tasks are separate. In preview mode, since the run and render happen at the same time, the cells are highlighted if they're bigger than the current "biggest".
vash
Michael,
I want to highlight min, max values for 2003, 2004 and 2005 columns.
So in total, 6 cells should be highlighted.
I dont understand what is the logic for highlighting in your report.
Thanks,
Vash
mwilliams
Vash,
I did this just for the max. Min should be able to be easily done from this.
Logic:
Step through the values in the onCreate method of the measure element to find the largest value for each year.
Store the current largest in a global variable named after the column when it's the largest current value.
In the onRender method of the measure element, compare the current value to the "max" value stored in the PGV, and highlight the element if they are the same.
vash
But the highlighting looks different than the logic you mentioned.
In 2003 column - 5 cells are highlighted, however we are calculating max - so only 1 cell should be highlighted.
Similarly for 2004 - 5 cells and 2005 - 3 cells are highlighted.
I am confused.
Thanks,
Vash
mwilliams
As noted in the post where I posted the design, run it in the web viewer mode, not in preview mode. Only 1 cell is highlighted for each column then. Sorry for any confusion.
mwilliams
If this way doesn't work for you, another way you could do it would be to put 2 identical crosstabs in a row, hiding the first one, and finding the min and max values in it to use in the second to highlight the correct values.
vash
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="69163" data-time="1286486980" data-date="07 October 2010 - 02:29 PM"><p>
If this way doesn't work for you, another way you could do it would be to put 2 identical crosstabs in a row, hiding the first one, and finding the min and max values in it to use in the second to highlight the correct values.<br /></p></blockquote>
<br />
<br />
Can you please show an example for this one.<br />
Cos, I need to generate html/pdf output for my reports - and in both the outputs its the same as the preview mode.<br />
<br />
Thanks,<br />
Vash
mwilliams
Vash,
So, you're not using the web viewer? Just the other outputs? If you export from the viewer to PDF, it works as expected as well.
To do it the other way, all you have to do is copy and paste the current crosstab below itself, then hide the first one. You can then delete the onRender code from the first and the onCreate code from the second.
vash
Yes, I am just using the other outputs.
I have a report server set up - which runs the report with the output format as pdf or html.
So I cant use the viewer mode.
However, your second method works fine.
Thank you so much for all the help.
Thanks,
Vash.
mwilliams
Not a problem. Glad to help!