Page 1 of 2

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

Posted: Thu Dec 20, 2007 3:56 am
by annerajb
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- ... n=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.

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

Posted: Fri Dec 21, 2007 5:07 pm
by annerajb
anybody any ideas ??

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

Posted: Fri Dec 21, 2007 7:06 pm
by monk.e.boy
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

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

Posted: Fri Dec 21, 2007 10:48 pm
by annerajb
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.

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

Posted: Sat Dec 22, 2007 5:12 am
by AmyStephen
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 :)

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

Posted: Wed Dec 26, 2007 6:23 pm
by annerajb
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

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

Posted: Fri Dec 28, 2007 11:53 am
by annerajb
hmm -_- as nobody has replied i will start implementing this as a component

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

Posted: Fri Dec 28, 2007 6:03 pm
by AmyStephen
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 :)

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

Posted: Sun Dec 30, 2007 12:21 pm
by annerajb
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 ;)

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

Posted: Tue Jan 01, 2008 8:24 am
by AmyStephen
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.

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

Posted: Thu Jan 03, 2008 1:12 am
by annerajb
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

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

Posted: Thu Jan 03, 2008 1:15 am
by AmyStephen
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 :)

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

Posted: Thu Jan 03, 2008 10:43 am
by annerajb
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.

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

Posted: Thu Jan 03, 2008 2:24 pm
by AmyStephen
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 :)

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

Posted: Thu Jan 03, 2008 3:20 pm
by annerajb
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

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

Posted: Thu Jan 03, 2008 4:17 pm
by annerajb
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

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

Posted: Tue Jan 08, 2008 8:51 pm
by jlleblanc
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.

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

Posted: Tue Jan 08, 2008 9:35 pm
by annerajb
what does destination means the folder where it goes?

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

Posted: Tue Jan 08, 2008 11:03 pm
by annerajb
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}

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

Posted: Mon Jan 14, 2008 3:39 am
by annerajb
bump need review

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

Posted: Mon Jan 14, 2008 9:42 pm
by jlleblanc
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.

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

Posted: Mon Jan 14, 2008 10:52 pm
by annerajb
where would be the best place for the swf? i currently have it on a place that will require uploading thru media manager

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

Posted: Mon Jan 14, 2008 11:14 pm
by jlleblanc
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

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

Posted: Wed Jan 16, 2008 9:59 pm
by annerajb
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.

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

Posted: Thu Jan 17, 2008 1:57 am
by jlleblanc
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.

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

Posted: Sun Jan 20, 2008 1:09 am
by annerajb
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.

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

Posted: Sun Jan 20, 2008 3:39 am
by AmyStephen
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 :)

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

Posted: Sun Jan 20, 2008 4:44 pm
by annerajb
ok fixed that stuff :D should work now if anything let me know.
btw good job on the documentation workshop :D

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

Posted: Mon Jan 21, 2008 12:47 am
by jlleblanc
Ok, that plugin is now displaying for me. Looking nice  :)

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

Posted: Mon Jan 21, 2008 6:58 am
by AmyStephen
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