Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:12:55+00:00 2026-06-10T06:12:55+00:00

Having a hard time getting multiple Y axis to show up on a chart

  • 0

Having a hard time getting multiple Y axis to show up on a chart using achartengine on android. I have tried to copy what was done on the “Multiple Temperature Chart” demo here: http://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/MultipleTemperatureChart.java but it won’t show the Y axis on the right, nor will it show the Yaxis labels I want to show.

Any ideas what my code might be doing wrong:

    mCurrentCostSeries = new XYSeries(costTitle);
    mCurrentEffSeries = new XYSeries(effTitle);

    mDataset.addSeries(mCurrentCostSeries);
    mDataset.addSeries(mCurrentEffSeries);



    int[] colors = new int[] { Color.RED, Color.YELLOW };
    PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.DIAMOND };
    mRenderer = new XYMultipleSeriesRenderer(2);
    setRenderer(mRenderer, colors, styles);
    int length = mRenderer.getSeriesRendererCount();
    for (int i = 0; i < length; i++) {
      XYSeriesRenderer r = (XYSeriesRenderer) mRenderer.getSeriesRendererAt(i);
      r.setLineWidth(3f);
    }

    mRenderer.setApplyBackgroundColor(true);
    mRenderer.setBackgroundColor(Color.argb(100, 50, 50, 50));

    mRenderer.setAxesColor(Color.LTGRAY);
    mRenderer.setZoomButtonsVisible(true);
    mRenderer.setPointSize(10);

    mRenderer.setChartTitle("Fuel Efficiency and Cost");


    mRenderer.setShowGrid(true);
    mRenderer.setXLabelsAlign(Align.RIGHT);
    mRenderer.setYLabelsAlign(Align.RIGHT);


    mRenderer.setYTitle(cunits,0);

    mRenderer.setLabelsColor(Color.WHITE);
    mRenderer.setXLabelsColor(Color.GREEN);
    mRenderer.setYLabelsColor(0, colors[0]);
    mRenderer.setYLabelsColor(1, colors[1]);



    mRenderer.setYTitle(dunits, 1);        // these lines SHOULD set the second Y axis 
    mRenderer.setYAxisAlign(Align.RIGHT, 1);// (series=1) but have no effect.
    mRenderer.setYLabelsAlign(Align.LEFT, 1);

I’m using a timeseries chart rather than a cubicline chart the demo uses but otherwise things ought to be almost the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:12:56+00:00Added an answer on June 10, 2026 at 6:12 am

    Make sure you allocate a separate scale number for the second series. For instance, initialize the mCurrentEffSeries this way and it will work:

    mCurrentEffSeries = new XYSeries(effTitle, 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having hard time getting this snippet to work. I have made a minimal
Anyone have any examples of javascript actionresults? I am having a hard time getting
I'm having a hard time getting better results on this query: I have the
I'm having a hard time getting my head around delegates. I tried putting together
I'm having a hard time getting XML values from an XML file using XPath.
I'm having a hard time getting the hang of this. Say I have: NSMutableArray
I'm using Extjs 4.0.7 and having a hard time getting a combobox in a
I am having hard time getting hasErrors to work with indexed properties. For example
I'm having a hard time getting my head around this, and Google just isn't
I am having a hard time getting the correct data out of an array.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.