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 6675301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:50:18+00:00 2026-05-26T03:50:18+00:00

I implemented the Line graph using the achartengine. But i want change the line

  • 0

I implemented the Line graph using the achartengine. But i want change the line graph background color. Somebody suggest that the following code for changing the background color.

mRenderer.setApplyBackgroundColor(true);
mRenderer.setBackgroundColor(Color.RED);

But it will not change the entire background. I want to change the entire background is it possible? if yes, then how to do it please can anybody help me.The following image is the output of the previous code.I want to change the entire bgcolor(means remaining black color part to white also)Grpah without entire bgcolor

Alinegraph.java

public class ALinegraph extends Activity
{

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState)

{

    super.onCreate(savedInstanceState);      
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);   
    setContentView(R.layout.main);

    Button Linegraph = (Button) findViewById(R.id.Linegraph);
    Linegraph.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v) {
              Linegraphpage ACTC = new Linegraphpage();
              Intent intent = ACTC.execute(ALinegraph.this);
              startActivity(intent);                  
        }});           
}

}

Linegraphpage.java

public class Linegraphpage extends AbstractDemoChart

{

  /**
   * Returns the chart name.
   * 
   * @return the chart name
   */
  public String getName() {
    return "Average temperature";
  }

  /**
   * Returns the chart description.
   * 
   * @return the chart description
   */
  public String getDesc() {
    return "The average temperature in 4 Greek islands (line chart)";
  }

  /**
   * Executes the chart demo.
   * 
   * @param context the context
   * @return the built intent
   */
  public Intent execute(Context context) {
    String[] titles = new String[] { "Crete","Corfu"};
    List<double[]> x = new ArrayList<double[]>();
    for (int i = 0; i < titles.length; i++) {
      x.add(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
    }
    List<double[]> values = new ArrayList<double[]>();
    values.add(new double[] { 12.3, 12.5, 13.8, 16.8, 20.4, 24.4, 26.4, 26.1, 23.6, 20.3 });
    values.add(new double[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 });

    int[] colors = new int[] { Color.CYAN,Color.GREEN};
    PointStyle[] styles = new PointStyle[] { PointStyle.CIRCLE,PointStyle.POINT};
    XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
    int length = renderer.getSeriesRendererCount();
    for (int i = 0; i < length; i++) {
      ((XYSeriesRenderer) renderer.getSeriesRendererAt(i)).setFillPoints(true);
    }
    setChartSettings(renderer, "", "", "price", 0, 12, 0, 190,
        Color.GREEN, Color.GREEN);
    renderer.setXLabels(10);
    renderer.setYLabels(7);    
    renderer.setShowGrid(false);
    renderer.setXLabelsAlign(Align.RIGHT);
    renderer.setYLabelsAlign(Align.RIGHT);
    renderer.setApplyBackgroundColor(true);
    renderer.setBackgroundColor(Color.WHITE);
    renderer.setZoomButtonsVisible(true);
    renderer.setPanLimits(new double[] { -10, 20, -10, 40 });
    renderer.setZoomLimits(new double[] { -10, 20, -10, 40 });

    Intent intent = ChartFactory.getLineChartIntent(context, buildDataset(titles, x, values),
        renderer, "");
    return intent;
  }

}

Updated image

enter image description here

  • 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-05-26T03:50:19+00:00Added an answer on May 26, 2026 at 3:50 am

    you should also set your margincolor:

    mRenderer.setApplyBackgroundColor(true);
    mRenderer.setBackgroundColor(Color.RED);
    mRenderer.setMarginsColor(Color.RED);
    

    This will give a whole view of your graph background to red color.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error: SCRIPT16385: Not implemented On the following line of code:
Can someone please tell me how I can implement the following line of pseudo-code.
I have implemented a small command line interface using JewelCLI and it creates an
I have a line of code that will take anywhere between 10-50 minutes to
I have implemented a graph generator using flex. The user can edit his graph
For a simple command-line todo manager (that is to be implemented in C), this
I implemented/copied the wu line algorithm from pseudo-code on wiki-pedia and other places. When
I want to write a command line daemon that runs forever. I understand that
I am developing the graph using kichart. But i don't know how to set
I want to implement the command line features like in a linux terminal. I

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.