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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:43:16+00:00 2026-05-28T13:43:16+00:00

I’m new in android and I want to use achartengine to implement time chart

  • 0

I’m new in android and I want to use achartengine to implement time chart that represent the daily outgoing call durations from call log.

Does any one know how can I do this and what should I do?

  • 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-28T13:43:17+00:00Added an answer on May 28, 2026 at 1:43 pm

    So you need a layout (main.xml):

        <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <LinearLayout
            android:id="@+id/chart"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" />
    
        <LinearLayout
            android:id="@+id/layXzoom"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:orientation="horizontal"
            android:padding="5dp" >
        </LinearLayout>
    
    </RelativeLayout>
    

    and activity (TestgrafActivity.java):

        package si.pd.testgraf;
    
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.Random;
    
    import org.achartengine.ChartFactory;
    import org.achartengine.GraphicalView;
    import org.achartengine.chart.PointStyle;
    import org.achartengine.chart.TimeChart;
    import org.achartengine.model.TimeSeries;
    import org.achartengine.model.XYMultipleSeriesDataset;
    import org.achartengine.renderer.XYMultipleSeriesRenderer;
    import org.achartengine.renderer.XYSeriesRenderer;
    
    import android.app.Activity;
    import android.graphics.Color;
    import android.os.Bundle;
    import android.widget.LinearLayout;
    
    public class TestgrafActivity extends Activity {
        /** Called when the activity is first created. */
        private XYMultipleSeriesDataset mDataset;
        private XYMultipleSeriesRenderer mRenderer;
        List<double[]> values = new ArrayList<double[]>();
        private GraphicalView mChartView;
        private TimeSeries time_series;
    
        // chart container
        private LinearLayout layout;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
    
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            layout = (LinearLayout) findViewById(R.id.chart);
    
            // create dataset and renderer
            mDataset = new XYMultipleSeriesDataset();
            mRenderer = new XYMultipleSeriesRenderer();
            mRenderer.setAxisTitleTextSize(16);
            mRenderer.setChartTitleTextSize(20);
            mRenderer.setLabelsTextSize(15);
            mRenderer.setLegendTextSize(15);
            mRenderer.setPointSize(3f);
    
            XYSeriesRenderer r = new XYSeriesRenderer();
            r.setColor(Color.GREEN);
            r.setPointStyle(PointStyle.CIRCLE);
            r.setFillPoints(true);
            mRenderer.addSeriesRenderer(r);
            mRenderer.setClickEnabled(true);
            mRenderer.setSelectableBuffer(20);
            mRenderer.setPanEnabled(true);
    
            time_series = new TimeSeries("test");
    
            mDataset.addSeries(time_series);
    
            fillData();
    
            mChartView = ChartFactory.getTimeChartView(this, mDataset, mRenderer,
                    "H:mm:ss");
    
            layout.addView(mChartView);
        }
    
        private void fillData() {
            long value = new Date().getTime() - 3 * TimeChart.DAY;
            for (int i = 0; i < 100; i++) {
                time_series.add(new Date(value + i * TimeChart.DAY / 4), i);
            }
        }
    }
    

    I didn’t tested the code so maybe there are some errors. Just wanted that you get the picture.

    I did test at home. If you give me an email, I can send you eclipse project.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.