Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Custom Label on Pie Chart
Custom Label on Pie Chart [message #655002] Thu, 17 February 2011 23:05 Go to next message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Hello,

I am adding a pie chart to an Eclipse RCP application. I have managed to
add the chart to the view. However I want to customize the labels. By
default the labels on show the numbers. I would like the labels to say
the series, number and percentage value.

How can I achieve this? Any pointers are greatly appreciated!

Best regards,
Tamer
Re: Custom Label on Pie Chart [message #655191 is a reply to message #655002] Fri, 18 February 2011 15:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Tamer,

Are you using the chart api or the BIRT report engine api?

Jason

On 2/17/2011 6:05 PM, Tamer wrote:
> Hello,
>
> I am adding a pie chart to an Eclipse RCP application. I have managed to
> add the chart to the view. However I want to customize the labels. By
> default the labels on show the numbers. I would like the labels to say
> the series, number and percentage value.
>
> How can I achieve this? Any pointers are greatly appreciated!
>
> Best regards,
> Tamer
Re: Custom Label on Pie Chart [message #655276 is a reply to message #655191] Fri, 18 February 2011 22:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Hi Jason,

Thanks for getting back to me.
I believe I am using the chart api.
I create the chart like this:
ChartWithAxes barChart = ChartWithAxesImpl.create();

Best regards,
Tamer


On 2/18/2011 7:12 AM, Jason Weathersby wrote:
> Tamer,
>
> Are you using the chart api or the BIRT report engine api?
>
> Jason
>
> On 2/17/2011 6:05 PM, Tamer wrote:
>> Hello,
>>
>> I am adding a pie chart to an Eclipse RCP application. I have managed to
>> add the chart to the view. However I want to customize the labels. By
>> default the labels on show the numbers. I would like the labels to say
>> the series, number and percentage value.
>>
>> How can I achieve this? Any pointers are greatly appreciated!
>>
>> Best regards,
>> Tamer
>
Re: Custom Label on Pie Chart [message #655547 is a reply to message #655276] Mon, 21 February 2011 17:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Tamer,

Assuming that ps is the PieSeries try something like:

DataPointComponent dpc = DataPointComponentImpl.create(
DataPointComponentType.ORTHOGONAL_VALUE_LITERAL,
JavaNumberFormatSpecifierImpl.create( "###,###" ) );
DataPointComponent dpca = DataPointComponentImpl.create(
DataPointComponentType.PERCENTILE_ORTHOGONAL_VALUE_LITERAL,
JavaNumberFormatSpecifierImpl.create( "##.##%") );
DataPointComponent dpcb = DataPointComponentImpl.create(
DataPointComponentType.SERIES_VALUE_LITERAL,
StringFormatSpecifierImpl.create( "") );

ps.getDataPoint( ).getComponents( ).clear( );
ps.getDataPoint( ).getComponents( ).add( dpc );
ps.getDataPoint( ).getComponents( ).add( dpca );
ps.getDataPoint( ).getComponents( ).add( dpcb );
ps.getLabel( ).setVisible( true );

Jason


On 2/18/2011 5:09 PM, Tamer wrote:
> Hi Jason,
>
> Thanks for getting back to me.
> I believe I am using the chart api.
> I create the chart like this:
> ChartWithAxes barChart = ChartWithAxesImpl.create();
>
> Best regards,
> Tamer
>
>
> On 2/18/2011 7:12 AM, Jason Weathersby wrote:
>> Tamer,
>>
>> Are you using the chart api or the BIRT report engine api?
>>
>> Jason
>>
>> On 2/17/2011 6:05 PM, Tamer wrote:
>>> Hello,
>>>
>>> I am adding a pie chart to an Eclipse RCP application. I have managed to
>>> add the chart to the view. However I want to customize the labels. By
>>> default the labels on show the numbers. I would like the labels to say
>>> the series, number and percentage value.
>>>
>>> How can I achieve this? Any pointers are greatly appreciated!
>>>
>>> Best regards,
>>> Tamer
>>
>
Re: Custom Label on Pie Chart [message #655852 is a reply to message #655547] Tue, 22 February 2011 20:45 Go to previous message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Jason,

Thank you so much! This worked perfectly! I really appreciate your help
and fast response!

Best regards,
Tamer

On 2/21/2011 9:39 AM, Jason Weathersby wrote:
> Tamer,
>
> Assuming that ps is the PieSeries try something like:
>
> DataPointComponent dpc = DataPointComponentImpl.create(
> DataPointComponentType.ORTHOGONAL_VALUE_LITERAL,
> JavaNumberFormatSpecifierImpl.create( "###,###" ) );
> DataPointComponent dpca = DataPointComponentImpl.create(
> DataPointComponentType.PERCENTILE_ORTHOGONAL_VALUE_LITERAL,
> JavaNumberFormatSpecifierImpl.create( "##.##%") );
> DataPointComponent dpcb = DataPointComponentImpl.create(
> DataPointComponentType.SERIES_VALUE_LITERAL,
> StringFormatSpecifierImpl.create( "") );
>
> ps.getDataPoint( ).getComponents( ).clear( );
> ps.getDataPoint( ).getComponents( ).add( dpc );
> ps.getDataPoint( ).getComponents( ).add( dpca );
> ps.getDataPoint( ).getComponents( ).add( dpcb );
> ps.getLabel( ).setVisible( true );
>
> Jason
>
>
> On 2/18/2011 5:09 PM, Tamer wrote:
>> Hi Jason,
>>
>> Thanks for getting back to me.
>> I believe I am using the chart api.
>> I create the chart like this:
>> ChartWithAxes barChart = ChartWithAxesImpl.create();
>>
>> Best regards,
>> Tamer
>>
>>
>> On 2/18/2011 7:12 AM, Jason Weathersby wrote:
>>> Tamer,
>>>
>>> Are you using the chart api or the BIRT report engine api?
>>>
>>> Jason
>>>
>>> On 2/17/2011 6:05 PM, Tamer wrote:
>>>> Hello,
>>>>
>>>> I am adding a pie chart to an Eclipse RCP application. I have
>>>> managed to
>>>> add the chart to the view. However I want to customize the labels. By
>>>> default the labels on show the numbers. I would like the labels to say
>>>> the series, number and percentage value.
>>>>
>>>> How can I achieve this? Any pointers are greatly appreciated!
>>>>
>>>> Best regards,
>>>> Tamer
>>>
>>
>
Previous Topic:Expose BIRT Reports
Next Topic:BI for linked open data
Goto Forum:
  


Current Time: Tue Apr 23 07:09:15 GMT 2024

Powered by FUDForum. Page generated in 0.03508 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top