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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:28:47+00:00 2026-06-08T03:28:47+00:00

UPDATE: All done! The LinearLayout needed an actual height and width to it. I’m

  • 0

UPDATE: All done! The LinearLayout needed an actual height and width
to it. I’m sure I shouldn’t need to add them but at least it gives me
something to work with. Ta. I would have self answered this but I
haven’t got enough of a reputation apparently and need to wait 8
hours. I had spent days trying to sort this out, post the question and
work it out in 2 hours. Soz.

I think I am doing something wrong. I have looked at some examples and thought I was doing pretty much the same thing – but clearly not.

UPDATE: Should have pointed out, I am using the aChartEngine graphing library to add a PieChartView to a LinearLayout

I have a method

protected DefaultRenderer buildCategoryRenderer(int[] colors) {
     if(renderer==null)
         renderer = new DefaultRenderer();

     renderer.setClickEnabled(true);
     renderer.setZoomEnabled(true);
     renderer.setSelectableBuffer(10);
     renderer.setApplyBackgroundColor(true);
     renderer.setBackgroundColor(Color.argb(100, 50, 50, 50));
     renderer.setChartTitleTextSize(20);
     renderer.setLabelsTextSize(15);
     renderer.setLegendTextSize(15);
     renderer.setMargins(new int[] { 20, 30, 15, 0 });
     renderer.setZoomButtonsVisible(true);
     renderer.setStartAngle(90);
     for (int color : colors) {

         SimpleSeriesRenderer r = new SimpleSeriesRenderer();
         r.setColor(color);
         renderer.addSeriesRenderer(r);
     }
     return renderer;
     }

which is called in onCreate() like so

MyDataSource dataSource = new MyDataSource(this);
    dataSource.open();
    dataSet = new CategorySeries("Analysis");
    int i = 0;
    for(String category:categoriesArray){
        dataSet.add(category, dataSource.getTotalForCategory(category).getNumbers().doubleValue());
        colors[i]=listOfColours[i];
        i++;
    }
    dataSource.close();
    buildCategoryRenderer(colors);

and then in onResume()

@Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();

        if(graph==null){
            graph = ChartFactory.getPieChartView(this, dataSet, renderer);
            LinearLayout graphLayout = (LinearLayout)findViewById(R.id.all_graph);
            graphLayout.addView(graph, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        }else{
            graph.repaint();
        }

    }

This is my xml layout

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"  android:scrollbars="vertical">
<TableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/summary_table" >
    <LinearLayout android:id="@+id/all_graph" 
    android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1">

    </LinearLayout>     
    <LinearLayout android:background="@android:drawable/list_selector_background" android:id="@+id/current_foo_row">
        <TextView
            android:id="@+id/foos_current_foo"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="10dp"
            android:text="@string/current"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium"
            android:textStyle="bold"
            />
        <TextView
            android:id="@+id/current_foo_value"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginTop="25dp"
            android:layout_weight="0.4"
            style="@android:style/TextAppearance.Holo.Medium"
            android:textStyle="bold"/>

        <ImageView 
            android:layout_width="0px" 
            android:layout_height="fill_parent"
            android:src="@android:drawable/ic_menu_more"  
            android:contentDescription="@string/more"
            android:layout_weight="0.1"/>
    </LinearLayout>

    <!-- Hidden bar in/Spend -->
    <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:visibility="gone" android:background="@drawable/back" android:id="@+id/bar_spend_row" style="@android:style/TextAppearance.DeviceDefault.Medium">
        <TextView
            android:id="@+id/bar_spend"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginLeft="10dp"
            android:text="@string/bar_spend"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"
            />
        <TextView
            android:id="@+id/bar_spend_value"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>

    </LinearLayout> 
    <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:visibility="gone" android:background="@drawable/back" android:id="@+id/bar_in_row" style="@android:style/TextAppearance.DeviceDefault.Medium">

        <TextView
            android:id="@+id/bar_in"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginLeft="10dp"
            android:text="@string/bar_in"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>
        <TextView
            android:id="@+id/bar_in_value"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>

    </LinearLayout> 
    <!--  FINISH -->
    <LinearLayout android:background="@android:drawable/list_selector_background" android:id="@+id/maybe_foo_row" style="@android:style/TextAppearance.DeviceDefault.Medium">
        <TextView
            android:id="@+id/foos_month_expected_foo"
            android:layout_width="0px" 
            android:layout_height="fill_parent"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="10dp"
            android:text="@string/expected" 
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium"
            android:textStyle="bold"
            />
         <TextView
            android:id="@+id/maybe_foo_value"
            android:layout_width="0px" 
            android:layout_height="fill_parent"
            android:layout_marginTop="25dp"
            android:layout_weight="0.4"
            style="@android:style/TextAppearance.Holo.Medium"
            android:textStyle="bold"/>
         <ImageView 
             android:layout_width="0px" 
            android:layout_height="fill_parent"
             android:src="@android:drawable/ic_menu_more" 
             android:contentDescription="@string/more"
             android:layout_weight="0.1"/>
    </LinearLayout>
    <!-- Hidden bar in/Spend -->
    <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:visibility="gone" android:background="@drawable/back" android:id="@+id/remaining_spend_row" style="@android:style/TextAppearance.DeviceDefault.Medium">
        <TextView
            android:id="@+id/remaining_spend"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginLeft="10dp"
            android:text="@string/remaining_spend"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>
        <TextView
            android:id="@+id/remaining_spend_value"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>

    </LinearLayout> 
    <LinearLayout android:layout_width="match_parent" android:layout_height="0px" android:visibility="gone" android:background="@drawable/back" android:id="@+id/remaining_in_row" style="@android:style/TextAppearance.DeviceDefault.Medium">

        <TextView
            android:id="@+id/remaining_in"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_marginLeft="10dp"
            android:text="@string/remaining_in"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>
        <TextView
            android:id="@+id/remaining_in_value"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="0.50"
            style="@android:style/TextAppearance.Holo.Medium.Inverse"/>

    </LinearLayout> 
    <!--  FINISH -->

    <LinearLayout >
        <Button
            android:id="@+id/foos_add_transaction_button"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="25dp"
            android:text="@string/add_transaction" 
            android:layout_gravity="center_horizontal"
            />
    </LinearLayout>

</TableLayout>

The outcome is that the chart is not displaying. Any ideas?

  • 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-08T03:28:49+00:00Added an answer on June 8, 2026 at 3:28 am

    The LinearLayout needed an actual height and width to it. I’m sure I shouldn’t need to add them but at least it gives me something to work with.

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

Sidebar

Related Questions

I have a table that I need to update where all columns are optionally
How can I update all of products to assign a certain user to them?
i want to update all records in my database(mongodb),I tried to use command below
I am trying to update all records in a column so that they start
I'd like to update all records with an empty string in all columns of
What I want: Update all new commits from server with my local repository in
I just pulled https://github.com/kolanos/kohana-universe and now I'm trying to update all the modules running:
I have 10000 documents in one MongoDB collection. I'd like to update all the
I want to perform an update on all the rows in an XML column
I want to know if there's any way to update from all versions (Example:

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.