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

  • Home
  • SEARCH
  • 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 8218163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:41:47+00:00 2026-06-07T12:41:47+00:00

I am working on Pie charts using AChartEngine library. Here I want to disable

  • 0

I am working on Pie charts using AChartEngine library. Here I want to disable chart values to show on charts, but only those whose content value is 0.

Now I am using it like:

         public Intent execute_assetLifecycle(Context context,RelativeLayout parent) {
    int[] colors = new int[] { Color.RED, Color.DKGRAY, Color.BLUE, Color.CYAN,Color.GREEN,Color.GRAY };
    DefaultRenderer renderer = buildCategoryRenderer(colors);

    CategorySeries categorySeries = new CategorySeries("Title1");


        categorySeries.add("30 Days=" days_count_30);  

        categorySeries.add("60 Days=", days_count_60);

        categorySeries.add("90 Days=", days_count_90);

        categorySeries.add("180 Days=", days_count_180);


    mChartView2=ChartFactory.getPieChartView(context, categorySeries,renderer);

    parent.addView(mChartView2);
    return ChartFactory.getPieChartIntent(context, categorySeries, renderer,null);
    }

    protected DefaultRenderer buildCategoryRenderer(int[] colors) {
    DefaultRenderer renderer = new DefaultRenderer();
    for (int color : colors) {
    SimpleSeriesRenderer r = new SimpleSeriesRenderer();
    r.setColor(color);
    renderer.addSeriesRenderer(r);

    }
    return renderer;
    }

I am using the above code to display pie chart with display values, but I want to show only those display values which are >0 otherwise They will not be shown on the charts as label like: 30 days=0

Please suggest any method that would stop displaying chart values when its value ==0

  • 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-07T12:41:48+00:00Added an answer on June 7, 2026 at 12:41 pm

    I would use an If-statement to check in the value is zero before adding the series.
    Maybe make your own wrapper-function for the categorySeries.add like thus:

    private void add(String category,double value){
        if(value != 0){
            categorySeries.add(category,value);
        }
    }
    

    You might have to limit the number of renderes to the number of actually added series.

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

Sidebar

Related Questions

When working with the pie chart in Google Charts it seems to ignore items
I working on HTML Canvas library to construct a PIE Chart Now to finish
I'm using jqplot for displaying bar chart and pie chart. I want to display
I have got the resize thing working but when i use the pie chart
I am working with Google Pie Charts API in Javascript. I am using Javascript
I am working with Highcharts Pie chart. I was using the legend on it,
So I'm working on a pie chart using HighSlide and ColdFusion. To make this
I can't seem to get PIE.htc working on this site. Here's my CSS: section#feature
I'm working with the ASP.NET Charting Library and I've got it generating a pie
I'm working on a project which includes generating pie and bar graph charts on

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.