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

How to add legend in the column chart Options · View
spradeesh
#1 Posted : Friday, October 22, 2010 1:32:04 PM
Rank: Member

Groups: Registered

Joined: 9/24/2010
Posts: 11
Location: Chennai
Team

How to add the legend in the column chart.

Thanks in advance

spradeesh
#2 Posted : Friday, October 22, 2010 1:47:11 PM
Rank: Member

Groups: Registered

Joined: 9/24/2010
Posts: 11
Location: Chennai
ChartArea chartArea = new ChartArea();
ChartSeries chartSeries1 = new ChartSeries();
ChartSeries chartSeries2 = new ChartSeries();
ChartSeries chartSeries3 = new ChartSeries();
ChartSeries chartSeries4 = new ChartSeries();

chartSeries1.setType(ChartTypes.Column);
chartSeries2.setType(ChartTypes.Column);
chartSeries3.setType(ChartTypes.Column);
chartSeries4.setType(ChartTypes.Column);

chartSeries1.setLegend("Jan");
chartSeries2.setLegend("Feb");
chartSeries3.setLegend("Mar");
chartSeries4.setLegend("Apr");


----

I have the above code. but legend is not getting displayed

Baydalka Volodymyr
#3 Posted : Friday, October 22, 2010 4:19:46 PM
Rank: Developers Team


Groups: Registered, Administrators

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

You need to add legend first. Please check following code.


Code:
ChartArea chartArea = new ChartArea();
ChartLehend chartLegend = new ChartLegend();
ChartSeries chartSeries1 = new ChartSeries();
ChartSeries chartSeries2 = new ChartSeries();
ChartSeries chartSeries3 = new ChartSeries();
ChartSeries chartSeries4 = new ChartSeries();

chartSeries1.setType(ChartTypes.Column);
chartSeries2.setType(ChartTypes.Column);
chartSeries3.setType(ChartTypes.Column);
chartSeries4.setType(ChartTypes.Column);

// ...

chartView.getAreas().add(chartArea );
chartView.getLegends().add(chartLegend);
chartView.getSeries().add(chartSeries1);
chartView.getSeries().add(chartSeries3);
chartView.getSeries().add(chartSeries3);
chartView.getSeries().add(chartSeries4);


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.