0

I am using achartengine to create a pie chart and I have no trouble creating it! the thing is, I want this pie chart to display on a layout with some other details. I have already created the activity and coded it. the pie chart method returns an intent so is there a way I can get the intent to show up in my layout!

thank you.

Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103
  • 1
    What about putting this chart in a view and put this view in a layout? – Jeremy D Jul 10 '12 at 17:01
  • can you please explain it to me! I am a newbie to android and m trying to learn so I can finish my college research! – Imesh Chandrasiri Jul 10 '12 at 17:04
  • Intents are there for starting other activities or services. You cannot embed another activity and its view(s) inside your current Activity's view. Once you start an intent your Activity is paused and gives control away to whatever you are calling. As Jeremy suggests, you need to figure out the name of the view component that is responsible for displaying charts. Embed that view inside your layout file. – tiguchi Jul 10 '12 at 17:10
  • I guess your chart is an image. You could create a activity, which is displayed on the screen using a specific layout containing an image view where you put this picture. It looks like you just generated the pie and you expect us to create this activity for you. My only advice will be to go on the android development page of the Android documentation and to look at the first examples, explaining all the notion you need to find a solution to this problem. – Jeremy D Jul 10 '12 at 17:25
  • I was going thru all the achartengine docs and found a method where I can pass the created intent to a graphical view! and the method is called GraphicalView() with params to put the intent! :) – Imesh Chandrasiri Jul 10 '12 at 17:42
  • Could you give the link you used? – Jeremy D Jul 11 '12 at 06:22
  • http://www.achartengine.org/content/javadoc/index.html this is the doc I read and the method is to get the pie chart directly as a view. – Imesh Chandrasiri Jul 11 '12 at 07:58

1 Answers1

1

You can find some extra information here. It explains exactly what you need to do in order to embed an AChartEngine chart view inside a layout.

Community
  • 1
  • 1
Dan D.
  • 32,246
  • 5
  • 63
  • 79