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 Search | Active Topics | Log In | Register

Labels on Pie Charts Options · View
kokopelli
#1 Posted : Wednesday, January 26, 2011 9:47:20 PM
Rank: Newbie

Groups: Registered

Joined: 1/24/2011
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 4:30:30 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
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 01, 2011 3:28:05 PM
Rank: Member

Groups: Registered

Joined: 7/13/2011
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 01, 2011 4:40:50 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

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

Best regards,
Volodymyr Baydalka
Andriod development and support team
anugil
#5 Posted : Tuesday, August 02, 2011 11:32:45 AM
Rank: Member

Groups: Registered

Joined: 7/13/2011
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).
Baydalka Volodymyr
#6 Posted : Tuesday, August 02, 2011 11:39:43 AM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
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-2016 ArtfulBits. All rights reserved.