 Rank: Member
Groups: Registered
Joined: 3/15/2010(UTC) Posts: 10
|
Hi, When I add a legend to the chart with more than two series. It works. But, when I add a legend that has only one series, it draw all of single point and its value for the legend. I have solved this problem by adding transparent dummy series. I post this issue for your information. I'm using aichart 1.5. Code: // adding a dummy series
ChartSeries dummy = new ChartSeries(" ", ChartTypes.CandleStick);
dummy.setBackColor(Color.TRANSPARENT);
addSeries(dummy);
Code:// adding a lenged
ChartLegend legend = new ChartLegend();
legend.setDock(ChartLayoutElement.Dock.Top);
legend.setAlignment(ChartLayoutElement.Alignment.Near);
legend.getTextPaint().setAntiAlias(true);
legend.getTextPaint().setColor(Color.WHITE);
mChartView.getLegends().add(legend);
Regards, Sung Ahn Kim.
|
|
|
|
 Rank: Member
Groups: Registered
Joined: 7/28/2009(UTC) Posts: 447 
|
Hi, Please, use next code to change legend items generation behavior. Code:legend.setItemsProvider(new LegendItemsProvider.SeriesItemsProvider());
Best regards, |
Volodymyr Baydalka Andriod development and support team |
|
|
|
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.