Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I make a barchart with only one series? #9

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment
Closed

Can I make a barchart with only one series? #9

GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.  Attempt to make a barchart with only one series
2. It doesn't work- get error and must force stop
3.

What is the expected output? What do you see instead?


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

must use XYMultipleSeriesDataset - makeBarChartIntent depends on it.  

What version of the product binary library are you using?

0.5

Please provide any additional information below.


Thanks,
Eric

Original issue reported on code.google.com by eric543...@gmail.com on 24 Aug 2010 at 8:11

@GoogleCodeExporter
Copy link
Author

The short answer is: sure you can.

You can modify the SalesStackedBarChart class in the demo this way and you will 
only get one single series built:

  public Intent execute(Context context) {
    String[] titles = new String[] { "2008" };//, "2007" };
    List<double[]> values = new ArrayList<double[]>();
    values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500,
        15500, 12600, 14000 });
//    values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 
11200, 9500, 10500,
//        11600, 13500 });
    int[] colors = new int[] { Color.BLUE };//, Color.CYAN };
    XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
    setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
        12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
    renderer.setXLabels(12);
    renderer.setYLabels(10);
    renderer.setDisplayChartValues(true);
    renderer.setXLabelsAlign(Align.LEFT);
    renderer.setYLabelsAlign(Align.LEFT);
    renderer.setZoomRate(1.1f);
    return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer, Type.DEFAULT);
  }

Original comment by dandrome...@gmail.com on 16 Nov 2010 at 5:51

  • Changed state: Done
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant