Home » Archived » BIRT » controling the order of Y series grouping (and legend) of a stacked bar chart
controling the order of Y series grouping (and legend) of a stacked bar chart [message #122354] |
Wed, 01 February 2006 00:38  |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
Hi,
I have stacked bar chart, with location names for Category(X) Series,
Percentage values for Value(Y) Series. The Optional Y Series Grouping is on
an attribute which can have values of 'High', Medium' and 'Low'.
The problem I have is that, whatever I do, the Y series groupings (and the
legend) are grouped as 'High', 'Low' and 'Medium'. It appears that the Y
series grouping values are being alphabetically sorted.
Is there anyway through which I can have the groupings show up as 'High',
'Medium' and 'Low' instead of 'High', 'Low' and 'Medium'? Any help will be
greatly appreciated.
Thanks
Reddy
|
|
|
Re: controling the order of Y series grouping (and legend) of a stacked bar chart [message #125606 is a reply to message #122354] |
Tue, 07 February 2006 16:31   |
Eclipse User |
|
|
|
Originally posted by: rrachamallu.hotmail.com
I found a workaround for this problem and wanted to share the workaround. If
you have a better way of doing this, please let me know.
I changed my query so that 'High' mapped to 1, 'Medium' mapped to 2 and
'Low' mapped to 3. With this the legend shows up in order (1, 2, 3).
I then implemented the 'beforeDrawLegendEntry' callback method.
function beforeDrawLegendEntry( label, context )
{
var labelValue = label.getCaption().getValue();
if(labelValue == 1) label.getCaption().setValue("High");
if(labelValue == 2) label.getCaption().setValue("Medium");
if(labelValue == 3) label.getCaption().setValue("Low");
}
This did the trick for me. The legend in my report now shows up as 'High',
'Medium', 'Low' in that order.
Thanks
Reddy
"Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
news:drph72$cm4$1@utils.eclipse.org...
> Hi,
> I have stacked bar chart, with location names for Category(X) Series,
> Percentage values for Value(Y) Series. The Optional Y Series Grouping is
> on an attribute which can have values of 'High', Medium' and 'Low'.
> The problem I have is that, whatever I do, the Y series groupings (and
> the legend) are grouped as 'High', 'Low' and 'Medium'. It appears that the
> Y series grouping values are being alphabetically sorted.
> Is there anyway through which I can have the groupings show up as 'High',
> 'Medium' and 'Low' instead of 'High', 'Low' and 'Medium'? Any help will be
> greatly appreciated.
>
> Thanks
> Reddy
>
|
|
|
Re: controling the order of Y series grouping (and legend) of a stacked bar chart [message #168550 is a reply to message #125606] |
Thu, 08 June 2006 11:19   |
Eclipse User |
|
|
|
This workaround doesn't work so well in that the Legend does not
increase in size to accommodate labels longer in length than the
original "1", "2", and "3" labels.
Reddy Rachamallu wrote:
> I found a workaround for this problem and wanted to share the workaround. If
> you have a better way of doing this, please let me know.
>
> I changed my query so that 'High' mapped to 1, 'Medium' mapped to 2 and
> 'Low' mapped to 3. With this the legend shows up in order (1, 2, 3).
>
> I then implemented the 'beforeDrawLegendEntry' callback method.
>
> function beforeDrawLegendEntry( label, context )
> {
> var labelValue = label.getCaption().getValue();
> if(labelValue == 1) label.getCaption().setValue("High");
> if(labelValue == 2) label.getCaption().setValue("Medium");
> if(labelValue == 3) label.getCaption().setValue("Low");
> }
>
> This did the trick for me. The legend in my report now shows up as 'High',
> 'Medium', 'Low' in that order.
>
> Thanks
> Reddy
>
> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
> news:drph72$cm4$1@utils.eclipse.org...
>> Hi,
>> I have stacked bar chart, with location names for Category(X) Series,
>> Percentage values for Value(Y) Series. The Optional Y Series Grouping is
>> on an attribute which can have values of 'High', Medium' and 'Low'.
>> The problem I have is that, whatever I do, the Y series groupings (and
>> the legend) are grouped as 'High', 'Low' and 'Medium'. It appears that the
>> Y series grouping values are being alphabetically sorted.
>> Is there anyway through which I can have the groupings show up as 'High',
>> 'Medium' and 'Low' instead of 'High', 'Low' and 'Medium'? Any help will be
>> greatly appreciated.
>>
>> Thanks
>> Reddy
>>
>
>
|
|
|
Re: controling the order of Y series grouping (and legend) of a stacked bar chart [message #168964 is a reply to message #168550] |
Sun, 11 June 2006 01:21  |
Eclipse User |
|
|
|
George,
How about using aHigh, bMedium and cLow. And then use the script to
remove the first letter. This should make sure
the labels are has enough space.
Carsten
George Handin wrote:
> This workaround doesn't work so well in that the Legend does not
> increase in size to accommodate labels longer in length than the
> original "1", "2", and "3" labels.
>
>
> Reddy Rachamallu wrote:
>> I found a workaround for this problem and wanted to share the
>> workaround. If you have a better way of doing this, please let me know.
>>
>> I changed my query so that 'High' mapped to 1, 'Medium' mapped to 2
>> and 'Low' mapped to 3. With this the legend shows up in order (1, 2, 3).
>>
>> I then implemented the 'beforeDrawLegendEntry' callback method.
>>
>> function beforeDrawLegendEntry( label, context )
>> {
>> var labelValue = label.getCaption().getValue();
>> if(labelValue == 1) label.getCaption().setValue("High");
>> if(labelValue == 2) label.getCaption().setValue("Medium");
>> if(labelValue == 3) label.getCaption().setValue("Low");
>> }
>>
>> This did the trick for me. The legend in my report now shows up as
>> 'High', 'Medium', 'Low' in that order.
>>
>> Thanks
>> Reddy
>>
>> "Reddy Rachamallu" <rrachamallu@hotmail.com> wrote in message
>> news:drph72$cm4$1@utils.eclipse.org...
>>> Hi,
>>> I have stacked bar chart, with location names for Category(X)
>>> Series, Percentage values for Value(Y) Series. The Optional Y Series
>>> Grouping is on an attribute which can have values of 'High', Medium'
>>> and 'Low'.
>>> The problem I have is that, whatever I do, the Y series groupings
>>> (and the legend) are grouped as 'High', 'Low' and 'Medium'. It
>>> appears that the Y series grouping values are being alphabetically
>>> sorted.
>>> Is there anyway through which I can have the groupings show up as
>>> 'High', 'Medium' and 'Low' instead of 'High', 'Low' and 'Medium'? Any
>>> help will be greatly appreciated.
>>>
>>> Thanks
>>> Reddy
>>>
>>
>>
|
|
|
Goto Forum:
Current Time: Sun Jun 08 11:04:40 EDT 2025
Powered by FUDForum. Page generated in 0.28389 seconds
|