Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="note"><ac:parameter ac:name="title">Under Construction</ac:parameter><ac:rich-text-body>
<p>This proposal is under construction and is not ready for review.</p></ac:rich-text-body></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Chart Component Proposal

Proposed Component Name Zend_Chart
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Chart
Proposers Karol Babioch <karol@babioch.de>
Wojciech Szela <wojciech.szela@gmail.com>
Mauricio Cuenca <macuenca@gmail.com>
Revision 1.1 - 18/03/2008 - Updated a few things
1.2 - 28/07/2008 - Changed name of proposal and classes to Zend_Chart
1.3 - 09/10/2008 - Wojciech joined the "team" and will take the lead
1.4 - 05/11/2008 - Updated the wiki according to the new cognitions (wiki revision: 20)

Table of Contents

1. Overview

A component for creating charts of all kinds.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Will be added at a further state.

  • This component will create all kinds of charts:
  • Following types will be supported in the beginnging: Histogram, Pie, Bar, Line, Doughnut, Scatterplot and Timeline
  • There will be different drivers, e.g. GD and SVG
  • Different renderers will add different kinds of effects, which will be applied to the chart itself

4. Dependencies on Other Framework Components

Will be added at a further state.

5. Theory of Operation

Will be added at a further state.

6. Milestones / Tasks

  • Milestone 1: Developing base api
  • Milestone 2: Setting up a prototpye in order to check api

7. Class Index

Will be added at a further state.

8. Use Cases

Will be added at a further state.

9. Class Skeletons

Will be added at a further state.

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
chart chart Delete
pie pie Delete
diagram diagram Delete
bar bar Delete
plot plot Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 12, 2008

    <p>I'm asking for any comments, wishes and ideas.</p>

  2. Feb 12, 2008

    <p>Well, for a start, you could see some libraries, in my case, I'm using Open Flash Chart <a href="http://teethgrinder.co.uk/open-flash-chart/">http://teethgrinder.co.uk/open-flash-chart/</a>, not the greatest OOP approach, but does the job and it looks cool and that's what my customers want. There is also phplot <a href="http://www.phplot.com">http://www.phplot.com</a> and some others.</p>

    <p>IMO, you could create an abstract class called Zend_Graph_Abstract and then create children classes based on that one (e.g. Zend_Graph_Bar, Zend_Graph_Pie, Zend_Graph_Scatter, etc), also I would implement a renderer abstract class (in order to use GD2 or maybe flash or whatever), something like Zend_Graph_Renderer_Abstract and Zend_Graph_Renderer_Gd2, Zend_Graph_Renderer_Flash, etc..</p>

    <p>Hope that can give you a light,</p>

    <p>Never though about this component, and it's really a nice idea.</p>

    <p>Aldemar</p>

  3. Feb 14, 2008

    <p>I'm thinking of another component, Zend_Font. Various Fonts are essential, but copying the Zend_Pdf implementation wouldn't be a nice step in terms of a perfect Object-oriented world.</p>

    <p>What do you think about this?</p>

    1. Feb 17, 2008

      <p>I think there should be a Zend_Font, and that would be used by both Zend_Pdf and Zend_Graph.</p>

      <p>Aldemar</p>

      1. Mar 06, 2008

        <p>Agreed. It looks like Zend_Pdf_Font has most of the functionality needed already – probably more than we actually need here! Do you think the Zend_Pdf maintainers would be willing to migrate their Zend_Pdf_Font implementation to a more generic Zend_Font?</p>

  4. Mar 24, 2008

    <p>I would like to encourage you using a different name!</p>

    <p>To be honest i expected a component for managing trees and hierarchies in a proposal called Zend_Graph. Trees and hierarchies are a all graphs (nodes connected somehow)</p>

    <p>Here is why: The word graph is not just a short version of graphic,<br />
    it mainly refres to this: <a class="external-link" href="http://en.wikipedia.org/wiki/Graph_%28mathematics%29">http://en.wikipedia.org/wiki/Graph_%28mathematics%29</a></p>

    <p>What about Zend_Chart or Zend_Diagram would this also fit your Idear?</p>

    <p>There is a already a fantastic php5 component from ez.no they called it "Graph" and had a big discussion about the name after the first release. But because of there promis not to brake backward compatibility there didn't changed it.</p>

    <p>Now you could do it better</p>

    <p>regards<br />
    Daniel </p>

  5. Apr 11, 2008

    <p>I don't know if you thought about all the possible charts, but here is a summary of some of the more common one:</p>
    <ul>
    <li>Bar (Horizontal or vertical)
    <ul>
    <li>Normal - Just one bar, divided by each of the X axis fields.</li>
    <li>grouped - Two or more bars, side by side also divided by each of the X axis fields.</li>
    <li>stacked - Two or more bars on top of each other also divided by each of the X axis fields..</li>
    </ul>
    </li>
    </ul>

    <ul>
    <li>Line
    <ul>
    <li>Normal - Just the line.</li>
    <li>Area - A line filled with a color.</li>
    </ul>
    </li>
    <li>Pie
    <ul>
    <li>I guess doughnut could be put in this category also, because it is basically a pie with a hole in the middle.</li>
    </ul>
    </li>
    <li>Points
    <ul>
    <li>Scatter - Points in the chart, on a X,Y value.</li>
    <li>Bubble - Same as the Scatter, but each point increases in size according to a third value.</li>
    </ul>
    </li>
    <li>Radar (AKA spider, or star).</li>
    </ul>

    <p>Then there are also the financial charts:</p>
    <ul>
    <li>High-Low
    <ul>
    <li>Normal</li>
    <li>Volume</li>
    </ul>
    </li>
    <li>Open-High-Low-Close
    <ul>
    <li>Normal</li>
    <li>Volume</li>
    </ul>
    </li>
    </ul>

    <p>In addition, some combination of charts could be accomplished. Bar, Line, Scatter and Area could all be combined between them, and shown in the same chart.</p>

    <p>I think any of them can be 2D or 3D.</p>

    <p>I know it should start simple, and it should definitely start with the more "normal" ones of bar, line and pie, but if you don't start thinking about expanding it to the more esoteric ones, I think it will be harder to do.</p>

    1. Apr 11, 2008

      <p>I just realized this looks like a lesson on charts, when my intention was on doing a wishlist and start a discussion on what charts to include. It was a badly written post, sorry about that.</p>

      <p>Regards,<br />
      Luis.</p>

  6. Apr 11, 2008

    <p>Since there is no info on what data to feed the class to create the chart, here's an idea. It would be great if the class played nicely with database results, a little like spreadsheet applications. So, if you did something like:</p>
    <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
    $result = $db->fetchAll("select Date, field1, field2 from MyTable");
    ]]></ac:plain-text-body></ac:macro>
    <p>that returned:</p>
    <ul>
    <li>04/02/2008, 4, 5</li>
    <li>04/05/2004, 44, 43</li>
    </ul>

    <p>Some examples of what would happen with different charts:<br />
    Bar:<br />
    If you use the $result to create a bar chart, configure it to group the data by columns, and configure it to use the first column as a label, it would create a chart with the first tick in the X axis labelled 04/02/2008 and the second 04/05/2004. In the first tick there would be two grouped bars with 4 and 5 on the Y axis, and in the second two bars with 44 and 43 on the Y axis.<br />
    If instead you configure it to group by row it would have a grouped bar with 4 and 44 on the Y axis, and in the second 5 and 43. The ticks would have no legend, but the chart would have on with the colour of the first bar (4 and 5) labelled as 04/02/2008, and the colour of the second bar (44, 43) labelled as 04/05/2004.</p>

    <p>Line:<br />
    If you used it to create a line chart grouped by columns with the first column as the label, the result would be one line going from 4 to 44 in the Y axis and 04/02/2008 to 04/05/2004, and a second line going from 5 to 43 in the Y axis, and again 04/02/2008 to 04/05/2004.<br />
    If grouped by row, line one goes from 4 to 5 and line two from 44 to 43, again with the chart legend being the same as the bar grouped by row and no label on the X axis ticks.</p>

    <p>Scatter:<br />
    Grouped by column: One point on X:4, Y:44 and another on X:5, Y:43<br />
    Grouped by row: One point on X:4, Y:5 and another on X:44, Y:43</p>

    <p>Since the results are just arrays anyway you are always free to feed something like "array(4, 5, 2, 6, 3)" to the class to create a chart.</p>

    <p>Of course the class should always have methods to override the labels for the charts and the ticks for the X and Y axis.</p>

    <p>I hope that was clear enough.</p>

    <p>Regards,<br />
    Luis </p>

  7. May 14, 2008

    <p>Karol and company, this proposal has a lot of potential. It seems that there are currently a lot of details missing, although community discussion has begun. Do you have some more details to fill in so that we can move this to the 'ready for review' section?</p>

    <p>,Wil</p>

  8. Jun 20, 2008

    <p>Please let me know if this proposal is still active. If I don't hear from you in one week, it will be a candidate for the Archived section.<br />
    Of course, once it is archived, you can always restart work on it by moving it back to the appropriate section.</p>

    <p>Thanks.<br />
    ,Wil</p>

    1. Oct 09, 2008

      <p>Hello</p>

      <p>Is someone still working on this component? If yes, I would like to join the team and contribute my work, if not, I would like to organize a team and open discussion on the development (starting from spec).</p>

      <p>Regards</p>

      <p>Wojciech Szela</p>

  9. Jul 28, 2008

    <p>Sorry guys ...</p>

    <p>I haven't done anything for a long while. I will read through your comments. Hopefully Chris is still interested. I will check this and a few other things and will give you more information in a few days.</p>

    <p>The first thing I will do now is to rename this proposal. As suggested it will now be called Zend_Chart. I hope everybody is happy with this "new" proposal.</p>

    <p>Hopefully this proposal gains the right to stay active.</p>

  10. Oct 09, 2008

    <p>Hey,</p>

    <p>good news: Wojciech Szela joined the team and has taken the "lead" of this project. If there is anyone out there, who want also to help, just contact us.</p>

    <p>We will setup the environment we will work with in the next few days and then hopefully start our work.</p>

    <p>I'm sorry for all this lags ...</p>

    <p>Best regards</p>

    1. Oct 12, 2008

      <p>Hello</p>

      <p>Thank you Karol for introducing me.</p>

      <p>As Karol wrote I took the lead of creating proposal of Zend_Chart. This component is quite important for me so I hope we will be able to provide proposal rather quick.</p>

      <p>To brainstorm about proposal and do not pollute this wiki I have created Trac and SVN instance on my server. Access is password protected but everyone is welcome to participate. Just drop me an e-mail and I'll pass you all required information. SVN and Trac are temporary and all collected there data will be moved here right after clarification of any idea for this component (and will begin brainstorming here).</p>

      <p>Kind regards</p>

      <p>Wojciech Szela</p>

  11. Oct 23, 2008

    <p>Hello</p>

    <p>I would like to update community about progress in Zend_Chart proposal development.</p>

    <p>In just two weeks team has grown up to 4 active members. Personally I think it shows how important for Zend Framework community component is.</p>

    <p>Environment and tools for working on proposal were agreed and implemented. One of them is wiki page available at <a href="http://trac.wojciechszela.com/projects/zendchart">http://trac.wojciechszela.com/projects/zendchart</a>. If you want to stay up to date with what the team is working on please login as guest, password is guest.</p>

    <p>We have agreed on first draft of architecture. We have identified five main components:</p>
    <ul>
    <li>driver - Understands how to draw image primitives like dots, lines, arcs, text.</li>
    <li>renderer - Understands how to render chart primitives, that is how to decompose chart primitives into image primitives. In other words uses Driver to render chart primitives. A primitive might be a bar, a label, a segment... Different renderers might interpret chart primitives in different ways, eg. render 2D or 3D charts.</li>
    <li>chart element - Understands how to compose chart element, eg. legend, grid, chart itself from chart primitives or in other words know how to decompose chart element into renderable chart primitives. Chart element provides interfaces to change its properties (eg. color) and data (eg. names of data series for legend)</li>
    <li>data model - Provides data for chart. It has to provide generic interface to request specific data, for example data set for specific point (data set in most cases is just a number) or names of data series, markers. It does not define from where and how data is read. It is up to developer to implement its own Data Model reading data from database, csv files, calculated mathematical functions and so one.</li>
    <li>chart - Composes chart from chart elements, applies settings on chart elements, creates a bridge between data and chart elements. Renders chart primitives requested from chart elements using a renderer.</li>
    </ul>

    <p>Chart will have to be given some data model, renderer and driver. It will create set of chart elements required to render chart, request data from data model and pass it to some of created chart elements, request chart elements to return sets of chart primitives to be rendered and pass those chart primitives to renderer. Renderer will convert chart primitives into image primitives and request driver to draw them.</p>

    <p>For details please read mentioned wiki. A diagram of architecture is available at wiki.</p>

    <p>If you have any comments please write them here or send me a message. Fact that we have agreed on architecture does not mean that we can not change it or that we do not want to change it. Any feedback is welcome, will be discussed and taken into account.</p>

    <p>Cheers</p>

    <p>Wojciech Szela</p>

    1. Oct 23, 2008

      <p>1) Your development area is password protected, and you didn't provide us with credentials.</p>

      <p>2) Isn't the wiki here sufficient? Isn't the point of all the tools Zend setup to use them for development of the framework?</p>

      1. Oct 24, 2008

        <p>1.) The credentials were posted and are guest//guest</p>

        <p>2.) We use the wiki in order to collect ideas and create some kind of arrangment. Important things will be published and discussed just here <ac:emoticon ac:name="smile" />.</p>

      2. Oct 24, 2008

        <p>Hi</p>

        <p>1) Proposal development area is password protected because I don't want everyone to mess up with it. On the other hand I welcome everyone to help us and I am sending login and password with edit privileges to everyone. I have posted credentials for read only access in last post. I think I should publish them somewhere on the top of this wiki.</p>

        <p>2) We use separate wiki because its purpose is to have some scrapbook. It is sort of manageable informal channel for people working on proposal. We could also have IRC meetings only (we have regular ones but their purpose is different) or send some documents to each other by e-mail but I don't think it is efficient. We want to publish here any idea we thing is good and formalized to state where discussion is possible. Until we are able to came out with any idea we share things over password protected wiki. If you have experience or ideas about how to organize efficient communication between people that work in different locations on same project on almost daily basis and at the same time do not pollute this tool I'll be glad to read about it and implement it.</p>

        <p>Kind regards</p>

        <p>Wojciech Szela</p>

    2. Oct 24, 2008

      <p><ac:image ac:thumbnail="true"><ri:attachment ri:filename="Zend_Chart-Architecture.gif" /></ac:image><br />
      Architecture draft</p>

  12. Jan 25, 2009

    <p>Hail, this tools is very usefull.</p>

    <p>Just add to great reference to your work for more complete it.<br />
    1.Dojo SVG based Chart.
    <a class="external-link" href="http://www.dojotoolkit.org/">http://www.dojotoolkit.org/</a>
    <a class="external-link" href="http://www.sitepen.com/blog/2008/06/06/a-beginners-guide-to-dojo-charting-part-1-of-2/">http://www.sitepen.com/blog/2008/06/06/a-beginners-guide-to-dojo-charting-part-1-of-2/</a><br />
    As you know, It is the best way, for have a optimize framework because the client process has reduce the server process and just you send the basic data for process the SVG with client script and browser. <ac:emoticon ac:name="smile" /><br />
    2.pChart php chart class library
    <a class="external-link" href="http://pchart.sourceforge.net/">http://pchart.sourceforge.net/</a><br />
    have good luck for your great work.</p>

  13. Apr 23, 2009

    <p>Hi everyone!</p>

    <p>This is a really great idea! I just love it!</p>

    <p>I have a question :</p>
    <ul class="alternate">
    <li>Will it be possible to generate a HTML map in order to make charts interactive ?</li>
    </ul>

    <p>I saw it on this page : <a class="external-link" href="http://framework.zend.com/issues/secure/Dashboard.jspa">http://framework.zend.com/issues/secure/Dashboard.jspa</a></p>

    <p>Cheers</p>

    <p>PS : Sorry for my poor english <ac:emoticon ac:name="wink" /></p>

  14. Dec 10, 2009

    <p>We are interested to "port" pChart to Zend Framework.<br />
    Might be we can joint our effort.</p>

    1. Dec 10, 2009

      <p>Hi,</p>

      <p>Sure, come on board. There was no development happening for long time, but recently I've devoted some time finish this thing. And it starts working, so more hands on keyboard are more than welcome. Can we get in touch by mail? Send me an e-mail to wojciech.szela at google mail and write me your IM account/nickname - skype, msn, icq...</p>

      <p>Cheers</p>

      <p>Wojtek</p>

  15. Feb 05, 2011

    <p>Archiving this proposal, feel free to recover it when you want to work on it again. For more details see <a href="http://framework.zend.com/wiki/display/ZFDEV/Archiving+of+abandoned+proposals+(Feb+5+2011)">this email</a>.</p>