whitespace COMPANY whitespace SERVICES whitespace PRODUCTS whitespace PURCHASE whitespace SUPPORT whitespace CONTACTS whitespace Home whitespace Contact Us whitespace Site Map whitespace
whitespace
SUPPORT
whitespace
FORUM
whitespace
FAQS
whitespace
SUBSCRIPTION
whitespace
REQUEST ON-LINE
whitespace
whitespace

Technical Support Forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
kokopelli  
#1 Posted : Wednesday, January 26, 2011 11:47:20 PM(UTC)
kokopelli
Rank: Newbie

Groups: Registered
Joined: 1/25/2011(UTC)
Posts: 4

Is there a way to set labels on a pie chart as a different value from the Legend? Specifically I want to list the % of each slice on the chart and use the legend to display what each slice is.

Baydalka Volodymyr  
#2 Posted : Friday, January 28, 2011 6:30:30 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Please check following code, it demonstrates how to set custom legend items format.

Quote:
series1.setShowLabel(true);
series1.setLabelFormat("{YVALUE0,#.##}");

ChartLegend legend = new ChartLegend();
ChartLegendItemsBinder itemsBinder = new ChartLegendItemsBinder("Label {YVALUE0,#.##} %");
legend.setItemsProvider(new LegendItemsProvider.PointItemsProvider(itemsBinder));

chartView.getLegends().add(legend);
chartView.getSeries().add(series1);


Best regards,
Volodymyr Baydalka
Andriod development and support team
anugil  
#3 Posted : Monday, August 1, 2011 5:28:05 PM(UTC)
anugil
Rank: Member

Groups: Registered
Joined: 7/13/2011(UTC)
Posts: 9
Location: US

series1.setShowLabel(true);// Anoop
series1.setLabelFormat("{YVALUE0,#.##}");

ChartLegend legend = new ChartLegend();
ChartLegendItemsBinder itemsBinder = new ChartLegendItemsBinder("Label {YVALUE0,#.##} %");
legend.setItemsProvider(new LegendItemsProvider.PointItemsProvider(itemsBinder));
chartView.getLegends().add(legend);



In Above code How can I change the value of Label string dynamically.

Like I have three value : My value1, My value 2 My value 3.

How can I display ?
like
labels in pie chart ex:

Myvalue1 22%
Myvalue2 33%
Myvalue3 45%

Baydalka Volodymyr  
#4 Posted : Monday, August 1, 2011 6:40:50 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Try to use following formatting - "Myvalue{INDEX} {PERCENT0,#.##} %"

Best regards,
Volodymyr Baydalka
Andriod development and support team
anugil  
#5 Posted : Tuesday, August 2, 2011 1:32:45 PM(UTC)
anugil
Rank: Member

Groups: Registered
Joined: 7/13/2011(UTC)
Posts: 9
Location: US

Thanks for the quick response.

But I want to see something like this
labels in pie chart ex:

abc 22%
dril data 33%
rock data 45%

anugil attached the following image(s):
Untitled.png (37kb) downloaded 35 time(s).

You cannot view/download attachments. Try to login or register.
Baydalka Volodymyr  
#6 Posted : Tuesday, August 2, 2011 1:39:43 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Ok, try other formatting - "{LABEL} {PERCENT0,#.##} %" and set point label.

ChartPoint p = series.getPoints().get(0);
p.setLabel("abc");

Best regards,
Volodymyr Baydalka
Andriod development and support team
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Company | Services | Practices | Technologies | Career | Contacts | Privacy
© 2005-2017 ArtfulBits. All rights reserved.