143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Google's Highly Open Participation Program tries to get young students into Open Source and Joomla! specifically. Everyone is welcome, there are not limits. You can be a coder, documenter, tester, translator to help out. Jump in and start helping!
annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Thu Dec 20, 2007 3:56 am

hello taking this as my third task wuju :D i decided to do the open flash chart as i will use it on my website too :D
http://code.google.com/p/google-highly-open-participation-joomla/issues/detail?sort=&colspec=ID%20Status%20ClaimedBy%20Summary&q=&can=2&id=143

current ideas i have for it let you specify using a csv file the data for the chart or a sql query havent event think about how to implement them :p
going to do this as a component but if anybody has a better idea for it i am all ears :D.
Last edited by AmyStephen on Mon Jan 21, 2008 7:06 am, edited 1 time in total.

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Fri Dec 21, 2007 5:07 pm

anybody any ideas ??

monk.e.boy
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue May 29, 2007 4:17 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby monk.e.boy » Fri Dec 21, 2007 7:06 pm

Hello,

  I got an email from Amy saying you were doing a joomla plugin for open flash chart - good idea!!

  I wrote open flash chart (with the help of lots of people) so if you have any questions, drop me an email ( http://teethgrinder.co.uk/open-flash-chart/contact.php ) or post in the forums on sourceforge.

  Mail me if you need the api to change or be cleaned up in any way. Lots of people moan about how crap it is, so I'm used to it by now ;-) there are some things I'd like to do to clean it, but the libraries do most of the painful work for people, so it's not that bad...

  anyhoooo... good luck :-)

monk.e.boy

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Fri Dec 21, 2007 10:48 pm

ok going to go a little off topic first need to clear my mind. my flight was supposed to go out at 7:05am i woke up at 4:00am and the cab took 2 hours so i got 30 minutes before my flight go out on the airport i am cool i know how to get pass security and all that on time even with 2 laptops on my backpack ;) but i forgot stuff on security so i missed my flight by 1 minute and after that i been living in the airport for 16 hours -_- cuz some guy changed my position on the flight list that i was a lower priority guy and i missed one flight so i been the whole day thinking about stuff like this extension :D.

monk.e.boy thanks for dropping by i really appreciate it.
so right now i am thinking of creating a custom format for generating graphs so people can paste the text and it will generate a chart base on the data.
the thing is sql querys wont do it alone i need a way for people to specify a lot of more stuff like column name chart type and other stuff so i am going to use xml with sql querys inside it.

this is a rought draft i will add more stuff into it l8r i cant think right now :p.
list of charts types
  • pie
  • line
  • bar
  • bar_3d
  • bar_glass
  • bar_outline
  • bar_fade
  • bar_sketch
  • area_hollow
  • scatter
  • candle
  • hlc

Code: Select all

<!-- graph types: pie, line, bar, bar_3d, bar_glass, bar_outline, bar_fade, bar_sketch, area_hollow, scatter, hlc, candle -->
<chart type="pie" height="300" width="400">
     <!-- in here we define the piece of the pie  inside the element tags we need put a number with the amount of this-->
     <element title="Clients US">SELECT Count(client_id) FROM client_list WHERE client_location = 'US'</element>
     <element>
          <title_obj>
               <title>Clients Puerto Rico</title>
               <title_style>{font-size: 35px; color: #800000}</title_style>
          </title_obj>
     <data type="sql">SELECT Count(client_id) FROM client_list WHERE client_location = 'PR'</data>
     <!-- in here is the url for the link of the pie slice if using pie url if not is ignored -->
     <link>www.google.com</link>
     </element>
</chart>

ill add more later gtg need to go claim my bags and charge the lappy.
Last edited by annerajb on Sat Dec 22, 2007 12:40 am, edited 1 time in total.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Sat Dec 22, 2007 5:12 am

Nice stuff going on in here.

monk.e.boy - u absolutely rock!  8) Thanks for sharing Open Flash Chart with the world.

And annerajb, thanks for making it through security with all that computing equipment and unleashing the power of this awesome graphing utility for the Joomla! community.

That's a very cool bit of XML there.

This is going to be a very good extension.

I'll be watching as this progresses.

Thanks to both of you!
Amy :)

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Wed Dec 26, 2007 6:23 pm

i feel retarded i found out that open flash chart already has a format for this -_- so after my vacations i will implement it with a component :D

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Fri Dec 28, 2007 11:53 am

hmm -_- as nobody has replied i will start implementing this as a component

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Fri Dec 28, 2007 6:03 pm

annerajb -

Did you have a question? I thought you said you decided to implement as a component. I didn't realize you were asking for opinions.

If you are asking for opinions, I suggest considering a plugin. If people are using the graphing within an article, using a plugin will allow them to embed a graph inside of a discussion.

If you create a component, you could have a gallery of graphs, but I'm not so certain how useful that would be? However, you could create the graph and store them inside of a component - so that things are organized - then use a plugin to show a graph in an article.

How do you see a component being useful? How do you plan to embed a graph in an article?

Those are some things to consider. Would be interested in hearing how you plan to put this capability into Joomla! end user hands.

I'll watch for your response.
Amy :)

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Sun Dec 30, 2007 12:21 pm

hmm i was thinking of creating a component for displaying one graph but what you said makes sense :p sorry i being so busy over this days that i havent coded anything so i have to sit down and analyze stuff thanks Amy.

to emebed the graph in the article i am going to use a data file that has all the graph data you only load the file and it does the work for you so it will something along these lines.

{graph sizeh|sizew|color|datafilepath}

:D happy new year everybody ;)

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Tue Jan 01, 2008 8:24 am

annerajb wrote:to emebed the graph in the article i am going to use a data file that has all the graph data you only load the file and it does the work for you so it will something along these lines.


Awesome!!! That can be automatically generated then by some type of reporting or data warehousing external function.

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Thu Jan 03, 2008 1:12 am

yeah it also can be dynamic if you use a php file to print the data file and have a dynamic chart but that will be outside of my plugin i quess as it would have to be custom made to a person need's anyway progress report got the chart working need to fix some things its going slow because i am on vacacation :D

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Thu Jan 03, 2008 1:15 am

SWEET! That's good thinking. I can see how extension developers would take advantage of this to extend the utility of their extension by using this capability.

Glad your moving forward, even if it's not as fast as you want! ;) That's a pretty big project. It's usually a good idea to go slow to give your mind time to think of the things like you mentioned above.

Amy :)

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Thu Jan 03, 2008 10:43 am

the only bug i have is that apparently i cant put the javascript in the headtag because it wont work so i have to echo the javascript in the middle of the page whenever i find a graph tag.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Thu Jan 03, 2008 2:24 pm

To load dynamic Javascript use the last example:

// Add Javascript
$document =& JFactory::getDocument();
$document->addScript( JURI::base() . 'plugins/content/example.js' );

// Load CSS
$document->addStyleSheet( JURI::base() . 'plugins/content/example.css', 'text/css', null, array( ' id' => 'StyleSheet' ) );

// Dynamic load of JS

$js = "new example().callExample({ \n";
$js .= "    etc', \n";
$js .= "}); ";

$document->addScriptDeclaration($js);


Let me know if that makes sense.
Amy :)

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Thu Jan 03, 2008 3:20 pm

when i mean it wont work is that i get a javascript error because it tries to run the js while the page loads and cant find the div tag best way would be to add it at the botton of the page so it dosnt slow the page down. can we get a option for addscript declaration that lets us put the js at the botton before the tag. it makes loading pages faster :D

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Thu Jan 03, 2008 4:17 pm

done :D need to create a xml file that will create some folder copy some files but idk how :(

i have 2 txt files that need to be placed in this folders images\chart
that way people can upload new charts using media manager :D
but idk how to copy the files there using the xml installer so any help will be appreciated
Last edited by annerajb on Thu Jan 03, 2008 4:21 pm, edited 1 time in total.

User avatar
jlleblanc
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Fri Aug 19, 2005 12:37 am
Location: Washington, DC / NoVA
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby jlleblanc » Tue Jan 08, 2008 8:51 pm

annerajb wrote:done :D need to create a xml file that will create some folder copy some files but idk how :(

i have 2 txt files that need to be placed in this folders images\chart
that way people can upload new charts using media manager :D
but idk how to copy the files there using the xml installer so any help will be appreciated




Hello annerajb,

The tag described on this page might be what you're after: http://dev.joomla.org/component/option, ... stallfile/

I checked the installer code and it should be available to plugins.
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Tue Jan 08, 2008 9:35 pm

what does destination means the folder where it goes?

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Tue Jan 08, 2008 11:03 pm

ok and update it didnt work apparently it only works for components :( i quess my plugin is done and people will have to create the path themselves using the media manager.
i am the first version of this :D check it out and tell me how it works
NOTE:you have to create the chart folder under the images folder and upload the data files in the zip file manually
after that you create a chart by writing {graph width|height|datafilepath}
{graph 600|425|images/chart/data-6.txt}
You do not have the required permissions to view the files attached to this post.
Last edited by annerajb on Tue Jan 08, 2008 11:06 pm, edited 1 time in total.

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Mon Jan 14, 2008 3:39 am

bump need review

User avatar
jlleblanc
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Fri Aug 19, 2005 12:37 am
Location: Washington, DC / NoVA
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby jlleblanc » Mon Jan 14, 2008 9:42 pm

Hi annerajb,

Sorry for the wait. The plugin doesn't seem to have the open-flash-chart.swf file, so the output isn't displaying. I'm looking back over this thread and it looks like a component like you suggested earlier might be a better route. A plugin would still be very helpful for embedding in content items, but the flexibility needed to store and manage graph data like that would really benefit from a plugin. I'm going to talk to some of the other judges and see what they think.
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Mon Jan 14, 2008 10:52 pm

where would be the best place for the swf? i currently have it on a place that will require uploading thru media manager

User avatar
jlleblanc
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Fri Aug 19, 2005 12:37 am
Location: Washington, DC / NoVA
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby jlleblanc » Mon Jan 14, 2008 11:14 pm

Assuming a plugin, you can use the section of the XML file to put your SWF under a subdirectory of /plugins/content rather than media manager. You would have /plugins/content/graphs and the file would sit in this directory. The SlideShare plugin does this: http://forum.joomla.org/index.php/topic ... msg1138258
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Wed Jan 16, 2008 9:59 pm

i will release a new version in this days sorry i take classes the whole week and have test each day and i dont have a lot of free time. about the component plugin i asked and amy told me it would be more useful a plugin because people can implement it on custom pages and have chart show up and  for uploading the data thats out of the scope of this as its very very advance. to create a program for generating data files.

User avatar
jlleblanc
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Fri Aug 19, 2005 12:37 am
Location: Washington, DC / NoVA
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby jlleblanc » Thu Jan 17, 2008 1:57 am

Yes, a plugin is definitely helpful for embedding within webpages. I'm a little concerned about the file format though. An import function would definitely take a bit of time to test and develop and probably isn't entirely necessary. However, a tool that could help the end users generate simpler files would definitely be worthwhile. It appears as though there are a lot of options that you could leave out for the tool, while pointing to some documentation for advanced users.

Since you're geared up to just do flat files for the moment, go ahead and complete the plugin this way. If I hear back from the others with more news, we can revisit this.
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Sun Jan 20, 2008 1:09 am

ok finally got time to get the next version this one has localization i consider this final unless somebody else finds a bug on it or suggestion in that case i will update it.
You do not have the required permissions to view the files attached to this post.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Sun Jan 20, 2008 3:39 am

I can't see any output.

I don't have this swfobject.js file. I do have a swf.js file. Is that what is needed?
//add the swf object file
$document->addScript(JURI::base() ."media/system/js/swfobject.js");


This function will not work for those installing into a folder - need to have the JURI::base() in front of the folders.

function getFlashJS($id, $heigh, $width, $data)
{
//$tmp = 'var so = new SWFObject("media/system/swf/open-flash-chart.swf", "ofc", "' . $heigh . '", "' . $width . '", "9", "#ffffff");
$tmp = 'var so = new SWFObject("plugins/content/open-flash-chart.swf", "ofc", "' . $heigh . '", "' . $width . '", "9", "#ffffff");
so.addVariable("data", "' . $data . '");
so.addParam("allowScriptAccess", "always" );//"sameDomain");
so.write("' . $id . '");';
return $tmp;
}


Obviously, there is not a lot of time remaining to reconsider the implementation. I think Joe is right in that some type of collection point that might be better maintained with a component could be very helpful . Then, perhaps the plugin would merely run a graph already created.

If you can fix those errors and help me see the graph, we'll get it sighned off. It's a good start and getting Open Flash Chart into Joomla! is desired. Perhaps you'll continue this work. Or, others might use your learning and extend it in important ways for the community. Ah, the beauty of open source solutions!

Thanks!
Amy :)

annerajb
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Tue Sep 04, 2007 8:59 pm

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby annerajb » Sun Jan 20, 2008 4:44 pm

ok fixed that stuff :D should work now if anything let me know.
btw good job on the documentation workshop :D
You do not have the required permissions to view the files attached to this post.

User avatar
jlleblanc
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Fri Aug 19, 2005 12:37 am
Location: Washington, DC / NoVA
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby jlleblanc » Mon Jan 21, 2008 12:47 am

Ok, that plugin is now displaying for me. Looking nice  :)
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 143 - Implement Open Flash Chart as a Joomla! v 1.5 Extension

Postby AmyStephen » Mon Jan 21, 2008 6:58 am

Yes, that is very nice!

Image

I want to see if I understand where we are. At this point, we have a plugin that can be used to generate Open Flash Chart graphs. And, that works great!

The challenge is creating those text files - and getting the files placed in a location that it can be used to generate a graph.

Currently, the site developer would manually construct these text files (suggesting a bit of knowledge of the environment), and then upload the files to a readily available location - as suggested by annerajb to be the images\charts folder.

What Joe suggests as a next step would be to create an administrative component that would create and store those files. Perhaps even generate the plugin literal to be stored within the article.

Annerajb - this task is accepted as complete. You have a usable - be it a bit on the complicated side - but the graphing environment is rich. Hopefully, you might continue working on this and develop a more user friendly component. Or, if you choose not too, someone else might building on these beginnings. This work is all here, available for review and reuse.

Get a JoomlaCode repository, if you have not already, and place a link to the download in your Google task. I'll mark it complete. (We have no more space, so we are simply adding links.)

monk.e.boy - the integration into Joomla! has begun. Thank *you* for liberating your work for others. It is FABULOUS and an entire community will enjoy your work.

Thanks!
Amy :)

Task closed


Return to “Google's Highly Open Participation Contest”

Who is online

Users browsing this forum: No registered users and 2 guests