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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:34:04+00:00 2026-05-27T18:34:04+00:00

I am currently trying to draw a graph within an Android application. The library

  • 0

I am currently trying to draw a graph within an Android application. The library I found is called GraphView (http://www.jjoe64.com/p/graphview-library.html). I am currently using version 2, which is available on GitHub.

Drawing graphs works really nicely. The code necessary to get a graph is the following:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Map<String,List<GraphEntry>> graphData = (...)

    if (graphData != null) {
        List<GraphEntry> entries = graphData.get("temperature");
        GraphView.GraphViewData[] data = new GraphView.GraphViewData[entries.size()];

        int i = 0;
        for (GraphEntry entry : entries) {
            data[i++] = new GraphView.GraphViewData(entry.getDate().getTime(), entry.getValue());
        }
        GraphView.GraphViewSeries graphViewSeries = new GraphView.GraphViewSeries("temperature", 0xffff0000, data);
        LineGraphView graphView = new LineGraphView(this, "temperature");
        graphView.addSeries(graphViewSeries);
        graphView.setShowLegend(true);

        LinearLayout graphLayout = (LinearLayout) findViewById(R.id.layout);
        graphLayout.addView(graphView);
    }
}

This will produce a normal graph. Unfortunately, all kinds of labels are missing. The documentation tells that for the normal use case, one does not have to care about labels, as the library does this automatically. What am I doing wrong? I only get the plain graph, without any labels.

For the completeness, I am adding the graph to a linear layout. The appropriate layout file has the following contents:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="fill_parent"
          android:padding="5dp"
          android:id="@+id/layout"
          android:orientation="vertical"
    ></LinearLayout>

The GraphEntry class is only a container with a java.util.Date attribute and a double value attribute.

Thank you very much for any help,

Matthias

  • 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-27T18:34:05+00:00Added an answer on May 27, 2026 at 6:34 pm

    I switched to another charting engine: AChartEngine. This one works out of the box.

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

Sidebar

Related Questions

I am currently trying to draw a selection of buttons for each item within
I'm currently trying to draw shapes with 2D Arrays. In my class there is
I'm currently trying to port a SIP stack library (pjSIP) to the PSP Console
I followed this tutorial and I'm currently trying to create a class to draw
I am new to JQuery library. I am currently trying to create a Draggable
I'm currently trying to draw a quadratic surface with openGL.When using a single window,my
I am currently trying to implement some code using Android to detect when a
Here is what I'm struggling with today: I'm trying to draw a graph using
I am currently trying to make a game in Android. I have this piece
I'm trying to draw in the currently selected system font using the ATSU api

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.