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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:33:24+00:00 2026-05-23T18:33:24+00:00

public static ArrayList<double[]> Value = new ArrayList<double[]>(); private double[] x = new double[10]; private

  • 0
public static ArrayList<double[]> Value = new ArrayList<double[]>();
    private double[] x = new double[10];
    private double[] y = new double[10];
    int counter = -1;

add.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                counter++;
                x[counter] = Double.parseDouble(income_1.getText().toString());
                y[counter] = Double.parseDouble(income_2.getText().toString());
                income_1.setText("");
                income_2.setText("");
            }
        });

publish.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Value != null) {
                    Value.add(x);
                    Value.add(y);
                    Intent intent = salesStackedBarChart.execute(BarChart.this,
                            Value, counter);
                    startActivity(intent);
                }
            }
        });


//and in SalesStackedBarChart.java class

public Intent execute(Context context, ArrayList<double[]> values ,int counter) {
        int count = counter + 1;
        double fcount = counter + 1.5;
        String[] titles = new String[] { "Android", "iPhone" };
        int[] colors = new int[] { Color.GREEN, Color.CYAN };
        XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
        setChartSettings(renderer, "Yearly revenue in the last "+count+" years", "Years", "revenue in $", 0.5,
                fcount, 0, 24000, Color.GRAY, Color.LTGRAY);
        renderer.setXLabels(count);
        renderer.setYLabels(10);
        renderer.setDisplayChartValues(true);
        renderer.setXLabelsAlign(Align.LEFT);
        renderer.setYLabelsAlign(Align.LEFT);
        renderer.setZoomRate(1.1f);
        renderer.setBarSpacing(0.5);
        return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
            Type.DEFAULT);
      }

// in AbstractDemoChart.java class

 protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) {
    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
    int length = titles.length;
    for (int i = 0; i < length; i++) {
      CategorySeries series = new CategorySeries(titles[i]);
      double[] v = values.get(i);
      int seriesLength = v.length;
      for (int k = 0; k < seriesLength; k++) {
        series.add(v[k]);
      }
      dataset.addSeries(series.toXYSeries());
    }
    return dataset;
  }

Run this project i get graph with x- axis value:

1,2,3,4,5....

But I want to print value:

2005,2006,2007,2008.....

I changed in some code like:

setChartSettings(renderer, "Yearly revenue in the last "+count+" years", "Years", "revenue in $", 2005,
                2010, 0, 24000, Color.GRAY, Color.LTGRAY);

and run project i get value of x-axis like:

2005,2006,2007....

but not get graph bar value. Values of all x-axis are null. How can I make this work?
x-axis value 1,2,3...

when change x-axis value 2006,2007,....

  • 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-23T18:33:25+00:00Added an answer on May 23, 2026 at 6:33 pm

    public static ArrayList<double[]> Value = new ArrayList<double[]>();
    private double[] x = new double[2010];
    private double[] y = new double[2010];
    int counter = 2005;

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

Sidebar

Related Questions

public static void main(String[] args) { List<? extends Object> mylist = new ArrayList<Object>(); mylist.add(Java);
public static List<Vertex<Integer>> petersenGraph() { List<Vertex<Integer>> v = new ArrayList<Vertex<Integer>>(); for (int i =
public static ArrayList GetStudentAsArrayList() { ArrayList students = new ArrayList { new Student() {
I have two Arrays that are initialized as such: public static double[] arrayweight= new
public static IList<T> LoadObjectListAll<T>() { ISession session = CheckForExistingSession(); var cfg = new NHibernate.Cfg.Configuration().Configure();
public static Logger getLogger() { final Throwable t = new Throwable(); final StackTraceElement methodCaller
public static string RatingCalculator(int input) { if (input < 10) { return string.Empty; }
public static int AwaitingApprovals() { int numApprovals = 0; string sql = SELECT COUNT(Type)
I end up with all the deliveries in the following array public static ArrayList
I've two different classes: Cliente.java public class Cliente { private static String user; private

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.