ibrahimsaputra / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

No way to override "Project" label in Pie Chart #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Modified ChartDemo's BudgetPieChart.java to change data legend title
   from "Project" to "Events".

2. The legend shows "Project-1 ... n, no matter what title you use in the 
   call to buildCategoryDataset at line 55.

What is the expected output? I expect to be able to change the legend with
the dataset values.

What do you see instead? The legend for the data series is always "Project-1 .. 
n.

Please provide a source code snippet that we can use to replicate the issue.

Line 55 was:
  return ChartFactory.getPieChartIntent(context, buildCategoryDataset("Project budget", values), renderer);

I changed to:
    return ChartFactory.getPieChartIntent(context, buildCategoryDataset("Events Percent", values), renderer);

What version of the product binary library are you using?
0.5.0

Please provide any additional information below.

Original issue reported on code.google.com by Ben.F...@gmail.com on 9 Jan 2011 at 4:31

GoogleCodeExporter commented 9 years ago
The legend labels are provided by the series category.
Take a look at BudgetPieChart. In the execute() method, the 
buildCategoryDataset() located in the super-class is called. In that method, 
several values are added to a CategorySeries.
In the series.add("Label", value), the first argument is the label for a 
specific item in the legend.

Original comment by dandrome...@gmail.com on 9 Jan 2011 at 10:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The first argument in buildCategorySeries() is not used by the legend.

Original comment by dandrome...@gmail.com on 9 Jan 2011 at 10:36