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
p.t.  
#1 Posted : Monday, May 30, 2011 10:47:32 PM(UTC)
p.t.
Rank: Newbie

Groups: Registered
Joined: 5/26/2011(UTC)
Posts: 8
Location: USA

Hi,

I've been evaluating this product for days now, it's a great product. But could you please help me with one problem?

I'm using the following code to generate the following chart. My question is: Why the legeds are point values? As you can see, I have set the series name to "My Name", why it's not showing as the legend? Thank you. (I've changed angle brackets to '@' because the forum does not allow them.)

Edited: I just found that if I added a second series, then the lendges would be correct. But if there is only one series, then the legends are all point values. Why is that???

Code:
ChartView cv = new ChartView(this);
cv.setLayoutParams(new LinearLayout.LayoutParams
        (LayoutParams.FILL_PARENT, 250));
cv.getAreas().add(new ChartArea());
ChartCollection@ChartLegend@ legends = cv.getLegends();
ChartLegend legend = new ChartLegend();
legends.add(legend);
ChartNamedCollection@ChartSeries@ seriesCollection = cv.getSeries();
ChartSeries series = new ChartSeries(
        "My Name", ChartTypes.get("Line"));
seriesCollection.add(series);
series.getPoints().setData(
        new double[] { 10, 134, 78, 21, 55, 31, 120, 81 } );


UserPostedImage

Edited by user Monday, May 30, 2011 10:53:36 PM(UTC)  | Reason: Not specified

Baydalka Volodymyr  
#2 Posted : Tuesday, May 31, 2011 1:30:25 PM(UTC)
Baydalka Volodymyr
Rank: Member

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

Hi,

That is default behavior of legend. If there is only one series, legend display points instead of series. You may change it with following code :

Code:
legend.setItemsProvider(new LegendItemsProvider.SeriesItemsProvider());



Best regards,
Volodymyr Baydalka
Andriod development and support team
p.t.  
#3 Posted : Tuesday, May 31, 2011 9:35:30 PM(UTC)
p.t.
Rank: Newbie

Groups: Registered
Joined: 5/26/2011(UTC)
Posts: 8
Location: USA

That worked beautifully! Thank you!
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.