Intents

23 views
Skip to first unread message

Donal Morrissey

unread,
Apr 21, 2010, 4:18:40 PM4/21/10
to chartdro...@googlegroups.com
Hi Karl,
It's mainly the pie chart in 1.x that I was referring to.

Would there be much work involved in updating the 2.x charts to support intents?

Cheers,
Donal

 
I much prefer the style of the charts generated by the chartroid chart engine (V1.x) than achartengine (v2.x), do you have any plans to update achartengine to support the style of V1.x ?

The two styles that I classify as "1.x" include (1) pie charts shown in a dialog window (as opposed to full screen) and (2) a calendar view.  Which of these are you referring to (or both)?  I wrote those two before integrating the achartengine code into my project.  For the charts I took from the achartengine project, I opted for the ContentProvider interface for passing data values, but left most of the rendering code as is.  So for your question, it depends on what style aspects from 1.x you are referring to.
 
Also, am I right in saying that only the chartroid chart engine charts (com.googlecode.chartdroid) support intents for displaying charts & graphs. I.e. for me, it is much easier to send an intent with data for a chart rather than having to create a Content Provider.

You are right, and I agree that the Intents are simpler to set up that the Content Provider.  Some day I might get around to adding an Intent-only interface to the 2.x plots.

I just created a Google Group for the app, so we can continue to discuss on that if you have any more questions.

Cheers,
Karl

Karl Ostmo

unread,
Apr 24, 2010, 1:13:45 AM4/24/10
to chartdro...@googlegroups.com
Would there be much work involved in updating the 2.x charts to support intents?

I'll outline the steps involved here to help myself later:
* I'll have to write a function similar to getAxisTitles() that falls back to the ContentProvider only if data is not carried directly with the Intent
* I would have to develop a scheme for the Extras key names to signify what type of data is being carried (float, int, long, etc.) inside the Intent.  Instead of a key name of simply com.googlecode.chartdroid.intent.extra.DATA like I used for the 1.x pie chart, the key names would probably have to look like com.googlecode.chartdroid.intent.extra.DATA.FLOAT.AXIS_X
 * ChartDroid would call getExtras().keySet() to find out which types and how many axes are used, and have switch cases that call getIntArrayExtra() or getFloatArrayExtra() based on the key names.


That said, it probably wouldn't hurt to learn ContentProviders for the time being.  I've just added an overview of their use to the wiki.  You can also look at the source to the market sales plotter project to get started.  If you get hung up anywhere, I'd be happy to help.

Karl
Reply all
Reply to author
Forward
0 new messages