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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:48:30+00:00 2026-06-14T16:48:30+00:00

I have a problem with aChartEngine. Im trying to display graph in home screen

  • 0

I have a problem with aChartEngine.
Im trying to display graph in home screen widget. So far unsuccessfully, the problem is when I get the bitmap into container it’s shrunk and not streched to match container width.
There is data which i see updating but it’s like on this image :

enter image description here

On image is container and graph loaded bitmap filling partially.

When this graph is added like this (to activity) there is no problems:

GraphicalView graph = ChartFactory.getTimeChartView(context, getDataSet(dates, values, seriesTitle), getRenderer(context, lblAxisY), "HH:mm");
graphLayout.removeAllViews();
graphLayout.addView(graph, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));

When I convert graph to bitmap and return it, it’s wrong:

float dpi = AndroidResolution.getScreenDpi(context);
        GraphicalView graph = ChartFactory.getTimeChartView(context, getDataSet(dates, values, seriesTitle), getRendererWidget(context,
                lblAxisY), "HH:mm");

        graph.setDrawingCacheEnabled(true);
        graph.layout((int) (0 * dpi), (int) (0 * dpi), (int) (100 * dpi), (int) (100 * dpi));
        graph.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
        graph.buildDrawingCache();
        graph.getDrawingCache();

        Bitmap bmp = Bitmap.createBitmap((int) (100 * dpi), (int) (100 * dpi), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bmp);
        graph.draw(canvas);

        return bmp;

I tried with various values for layout and bitmap size but I get always something distorted and shrunk. I can not get view width and height since it’s a remoteview.

Method that recieves bmp:

remoteView.setImageViewBitmap(R.id.imgRecentDetails, AndroidPlot.generateTimePlot(context, values, dates,"VALUES", "AXIS Y")));

Renderer code :

XYMultipleSeriesRenderer returningRenderer = new XYMultipleSeriesRenderer();
    returningRenderer.setApplyBackgroundColor(true);
    returningRenderer.setBackgroundColor(Color.argb(0, 0, 255, 0));
    returningRenderer.setMarginsColor(Color.argb(0, 0, 255, 0));
    returningRenderer.setGridColor(Color.argb(119, 128, 128, 128));
    returningRenderer.setShowGrid(true);
    returningRenderer.setShowLegend(false);
    returningRenderer.setAxisTitleTextSize(dpi * 3);
    returningRenderer.setChartTitleTextSize(dpi * 3);
    returningRenderer.setYLabels(5);
    returningRenderer.setXLabels(3);
    returningRenderer.setYTitle(lblAxisY);
    returningRenderer.setAntialiasing(true);
    returningRenderer.setYAxisMax(100);
    returningRenderer.setYAxisMin(0);
    returningRenderer.setYLabelsAlign(Align.RIGHT, 0);
    returningRenderer.setYLabelsColor(0, Color.WHITE);
    returningRenderer.setXLabelsColor(Color.WHITE);
    returningRenderer.setZoomEnabled(false);
    returningRenderer.setInScroll(true);
    returningRenderer.setPanLimits(new double[] { 0, 1000, 0, 0 });
    returningRenderer.setPanEnabled(true, false);
    XYSeriesRenderer renderer = new XYSeriesRenderer();
    renderer.setPointStyle(PointStyle.POINT);
    renderer.setColor(Color.WHITE);
    renderer.setFillBelowLine(true);
    renderer.setFillBelowLineColor(Color.argb(255, 23, 123, 189));
    returningRenderer.addSeriesRenderer(renderer);
    return returningRenderer;

Any insight or solution greatly welcome.

UPDATE: I tried it also in regular activity and it’s also shrunk (used graph.toBitmap()) in top left corner of container.

  • 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-14T16:48:31+00:00Added an answer on June 14, 2026 at 4:48 pm

    Try with returningRenderer.setInScroll(false).

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

Sidebar

Related Questions

I have a problem. I'm making a graph with AChartEngine and I would like
I have problem with displaying bitmap image on imageview on high density screen (480x800).
I have problem while loading data into html select when users press or click
I have an issue with an achartengine graph - as in this screenshot: It
I have problem adding markers into marker Clusterer of Google Maps. Firebug returns error:
I have problem with jCaret plugin in IE. jCaret downloads I want to get
i have problem passing data from one page to another using GET, for example
I have problem with sending objects via TCPClient. At first, I serialize them into
I have problem with Visual Studio Designer. When I display design of a form,
I'm trying to get a chart engine up and running. My problem is that

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.