Author: drashid Date: 2010-01-21 12:19:12 +0100 (Thu, 21 Jan 2010) New Revision: 26976
Added: plugins/stOfcPlugin/branches/1.4/LICENSE plugins/stOfcPlugin/branches/1.4/README plugins/stOfcPlugin/branches/1.4/config/ plugins/stOfcPlugin/branches/1.4/doc/ plugins/stOfcPlugin/branches/1.4/lib/ plugins/stOfcPlugin/branches/1.4/modules/ plugins/stOfcPlugin/branches/1.4/package.xml plugins/stOfcPlugin/branches/1.4/web/ Log: Copied: plugins/stOfcPlugin/branches/1.4/LICENSE (from rev 26975, plugins/stOfcPlugin/branches/1.2/LICENSE) =================================================================== --- plugins/stOfcPlugin/branches/1.4/LICENSE (rev 0) +++ plugins/stOfcPlugin/branches/1.4/LICENSE 2010-01-21 11:19:12 UTC (rev 26976) @@ -0,0 +1,20 @@ +Plugin by RASHID Dawood (drashid). (daud55[at]gmail[dot]com) +Original library by John Glazebrook (http://teethgrinder.co.uk/open-flash-chart/index.php) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +To Read original library's license see README.txt in plugin's lib folder Copied: plugins/stOfcPlugin/branches/1.4/README (from rev 26975, plugins/stOfcPlugin/branches/1.2/README) =================================================================== --- plugins/stOfcPlugin/branches/1.4/README (rev 0) +++ plugins/stOfcPlugin/branches/1.4/README 2010-01-21 11:19:12 UTC (rev 26976) @@ -0,0 +1,276 @@ +stOfcPlugin +=========== + +`stOfcPlugin` class provides abstraction for [Open Flash Chart](http://teethgrinder.co.uk/open-flash-chart/index.php). +Creates Flash Chart based on an array of data. + +Using stOfcPlugin you can create different types of charts like, + + * Bar Chart + + * Line Chart + + * 3D Bar Chart + + * Pie Chart + + * Bars + Lines + + * Area Chart + + * Scatter Chart + + * Mixed Scatter Chart + + * Candle + +Installation +============ + +Install the plugin: + + $ symfony plugin:install stOfcPlugin + +Or download it and unzip in your /plugins directory + +Clear you cache: + + $ symfony cc + +Usage +===== + +You just need to add the following line of code in your template where you want to create graph + + [php] + <?php stOfc::createChart(500, 250, '@bar_chart_data', false); ?> + +>**Note** +>The first three parameters are height, width and URL for data + + + +Bar Chart +--------- + +Following is an example of a bar chart: + + [php] + public function executeBarChartData() + { + $chartData = array(); + + //Array with sample random data + for( $i = 0; $i < 7; $i++ ) + { + $chartData[] = rand(1,20); + } + + //To create a bar chart we need to create a stBarOutline Object + $bar = new stBarOutline( 80, '#78B9EC', '#3495FE' ); + $bar->key( 'Number of downloads per day', 10 ); + + //Passing the random data to bar chart + $bar->data = $chartData; + + //Creating a stGraph object + $g = new stGraph(); + $g->title( 'stOfcPlugin example', '{font-size: 20px;}' ); + $g->bg_colour = '#E4F5FC'; + $g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 ); + $g->x_axis_colour( '#8499A4', '#E4F5FC' ); + $g->y_axis_colour( '#8499A4', '#E4F5FC' ); + + //Pass stBarOutline object i.e. $bar to graph + $g->data_sets[] = $bar; + + //Setting labels for X-Axis + $g->set_x_labels(array( 'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday' )); + + // to set the format of labels on x-axis e.g. font, color, step + $g->set_x_label_style( 10, '#18A6FF', 0, 2 ); + + // To tick the values on x-axis + // 2 means tick every 2nd value + $g->set_x_axis_steps( 2 ); + + //set maximum value for y-axis + //we can fix the value as 20, 10 etc. + //but its better to use max of data + $g->set_y_max( max($chartData) ); + $g->y_label_steps( 4 ); + $g->set_y_legend( 'stOfcPlugin', 12, '#18A6FF' ); + echo $g->render(); + + return sfView::NONE; + } + +Line Chart +---------- + +Following is an example of a line chart: + + [php] + public function executeLineChartData() + { + $chartData = array(); + for( $i = 0; $i < 7; $i++ ) + { + $chartData[] = rand(0, 50); + } + + //Create new stGraph object + $g = new stGraph(); + + // Chart Title + $g->title( 'stOfcPlugin example', '{font-size: 20px;}' ); + $g->bg_colour = '#E4F5FC'; + $g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 ); + $g->x_axis_colour( '#8499A4', '#E4F5FC' ); + $g->y_axis_colour( '#8499A4', '#E4F5FC' ); + + //Use line_dot to set line dots diameter, text, color etc. + $g->line_dot(2, 3, '#3495FE', 'Number of downloads per day', 10); + + //In case of line chart data should be passed to stGraph object + //unsing set_data + $g->set_data( $chartData ); + + //Setting labels for X-Axis + $g->set_x_labels( array( 'Mon','Tue','Wed','Thu','Fri','Sat','Sun' ) ); + + //to set the format of labels on x-axis e.g. font, color, step + $g->set_x_label_style( 10, '#18A6FF', 0, 1 ); + + //set maximum value for y-axis + //we can fix the value as 20, 10 etc. + //but its better to use max of data + $g->set_y_max( max($chartData) ); + + $g->y_label_steps( 5 ); + + // display the data + echo $g->render(); + + echo $g->render(); + + return sfView::NONE; + } + +Pie Chart +--------- + +Following is an example of pie chart, + + [php] + public function executePieChartData() + { + $chatData = array(); + for( $i = 0; $i < 7; $i++ ) + { + $data[] = rand(5,20); + } + + //Creating a stGraph object + $g = new stGraph(); + + //set background color + $g->bg_colour = '#E4F5FC'; + + //Set the transparency, line colour to separate each slice etc. + $g->pie(80,'#78B9EC','{font-size: 12px; color: #78B9EC;'); + + //array two arrray one containing data while other contaning labels + $g->pie_values($data, array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')); + + //Set the colour for each slice. Here we are defining three colours + //while we need 7 colours. So, the same colours will be + //repeated for the all remaining slices in the same order + $g->pie_slice_colours( array('#d01f3c','#356aa0','#c79810') ); + + //To display value as tool tip + $g->set_tool_tip( '#val#%' ); + + $g->title( 'stOfcPlugin example', '{font-size:18px; color: #18A6FF}' ); + echo $g->render(); + + return sfView::NONE; + } + +3D Bar Chart +------------ + +Following is an example of 3D bar chart, + + [php] + public function execute3DBarChartData() + { + //Create new stBar3D object and set the transparency and colour. + $redBar = new stBar3D( 75, '#d01f3c' ); + $redBar->key( '2007', 10 ); + + //random data + for( $i = 0; $i < 12; $i++ ) + { + $redBar->data[] = rand(200,500); + } + + //2nd Bar + $blueBar = new stBar3D( 75, '#356aa0' ); + $blueBar->key( '2008', 10 ); + + //random data for 2nd bar + for( $i = 0; $i < 12; $i++ ) + { + $blueBar->data[] = rand(200,500); + } + + $g = new stGraph(); + $g->bg_colour = '#E4F5FC'; + $g->title( 'Number of downloads in 2008 and 2009', '{font-size:20px; color: #18A6FF;}' ); + + $g->data_sets[] = $redBar; + $g->data_sets[] = $blueBar; + + //to create 3d x-axis + $g->set_x_axis_3d( 10 ); + $g->x_axis_colour( '#8499A4', '#E4F5FC' ); + $g->y_axis_colour( '#8499A4', '#E4F5FC' ); + + $g->set_x_labels( array( 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct', 'Nov', 'Dec' ) ); + $g->set_y_max( 500 ); + $g->y_label_steps( 5 ); + $g->set_y_legend( 'stOfcPlugin', 12, '#18A6FF' ); + echo $g->render(); + return sfView::NONE; + } + +>**Note** +>See stOfcExample module for details. + +Configuration +============= + + * To test stOfcPlugin, enable the __stOfcExample__ module in your `settings.yml``file, then call __stOfcExample__ in your browser + +setting.yml + + all: + .settings: + enabled_modules: [stOfcExample] + +Plugin support +============== + + * Please report bugs/feeback in the [plugin section](http://www.symfony-project.com/forum/index.php/f/12/) of the forum + * You can also contact me by email (at plugin's homepage) + +Stay tuned for detailed documentation + +cheers :) + +---- + +This plugin is sponsored by [SQL Technologies](http://www.sqltechnologies.com) + +  \ No newline at end of file Copied: plugins/stOfcPlugin/branches/1.4/package.xml (from rev 26975, plugins/stOfcPlugin/branches/1.2/package.xml) =================================================================== --- plugins/stOfcPlugin/branches/1.4/package.xml (rev 0) +++ plugins/stOfcPlugin/branches/1.4/package.xml 2010-01-21 11:19:12 UTC (rev 26976) @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.6.2" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> + <name>stOfcPlugin</name> + <channel>pear.symfony-project.com</channel> + <summary>Integrates "Open Flash Chart" for symfony framework.</summary> + <description>stOfcPlugin creates Flash Chart based on an array of data/values</description> + <lead> + <name>RASHID Dawood</name> + <user>drashid</user> + <email>[email protected]</email> + <active>yes</active> + </lead> + <date>2009-04-14</date> + <time>02:30:45</time> + <version> + <release>1.0.1</release> + <api>1.0.1</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.symfony-project.com/license">MIT license</license> + <notes>-</notes> + <contents> + <dir name="/"> + <file md5sum="573d934c93ded9412c06cfda28887052" name="config/routing.yml" role="data"/> + <file md5sum="cd1ea545f0b50d0f71b92a8429c3fed9" name="config/stOfcPluginConfiguration.class.php" role="data"/> + <file md5sum="d32239bcb673463ab874e80d47fae504" name="doc/gpl.txt" role="data"/> + <file md5sum="b0a0016817b3842ac432ba033af8e154" name="lib/ofc/open_flash_chart_object.php" role="data"/> + <file md5sum="8d4b1571844abde3e3710deae7786c89" name="lib/ofc/open-flash-chart.php" role="data"/> + <file md5sum="35887e93a5d7bbb9efa3c807ebadc600" name="lib/ofc/README.txt" role="data"/> + <file md5sum="a24965ceaffe1caf311ca0bd232d0eca" name="lib/stBar.class.php" role="data"/> + <file md5sum="48a04fb577beda5b00cd392b1aecdd8b" name="lib/stBar3D.class.php" role="data"/> + <file md5sum="35b6a895c87d4c156ba0c79e5f04a824" name="lib/stBarFade.class.php" role="data"/> + <file md5sum="a838b9388eb1073b8041052509e13535" name="lib/stBarGlass.class.php" role="data"/> + <file md5sum="dfb83fa202d3ada4449f32da6c39e517" name="lib/stBarOutline.class.php" role="data"/> + <file md5sum="dfb83fa202d3ada4449f32da6c39e517" name="lib/stBarSketch.class.php" role="data"/> + <file md5sum="9759aa5de84509cf2d51fcf4ef600545" name="lib/stCandle.class.php" role="data"/> + <file md5sum="07c6a20fa9df4993ad5d7b9bf9d88ca9" name="lib/stGraph.class.php" role="data"/> + <file md5sum="66a980a27796d25ed296168238fb6936" name="lib/stHlc.class.php" role="data"/> + <file md5sum="9210035617d9c534a810e95182b16063" name="lib/stLine.class.php" role="data"/> + <file md5sum="589b90de7bf149239aad6d8106a6fa4d" name="lib/stLineDot.class.php" role="data"/> + <file md5sum="831d090a75131c7f2879c616151db471" name="lib/stLineHollow.class.php" role="data"/> + <file md5sum="fad739f4cb3c185a28e0f48e71a99154" name="lib/stOfc.class.php" role="data"/> + <file md5sum="e983deeb2f0f33cb9b669a523472b5c5" name="lib/stPoint.class.php" role="data"/> + <file md5sum="802e0a728d1e6e16280d176913b68d8b" name="modules/stOfcExample/actions/actions.class.php" role="data"/> + <file md5sum="9686336d2cd6cc8ab6603ee1a7f14dc4" name="modules/stOfcExample/templates/indexSuccess.php" role="data"/> + <file md5sum="7a74d3d615135b674c63a0af6ce9420e" name="web/images/open-flash-chart.swf" role="data"/> + <file md5sum="fc36c10f8baf6c90e6eab2d0a761a0b2" name="web/js/swfobject.js" role="data"/> + <file md5sum="f14eec0de37cf1e53171a74e87576cea" name="LICENSE" role="data"/> + <file md5sum="9af8974db96b99ed71a096b73d8a2053" name="README" role="data"/> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.1.0</min> + </php> + <pearinstaller> + <min>1.4.1</min> + </pearinstaller> + <package> + <name>symfony</name> + <channel>pear.symfony-project.com</channel> + <min>1.1.0</min> + <max>1.3.0</max> + <exclude>1.3.0</exclude> + </package> + </required> + </dependencies> + <phprelease/> + <changelog> + <release> + <version> + <release>1.0.1</release> + <api>1.0.1</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.symfony-project.com/license">MIT license</license> + <date>2009-04-13</date> + <license>MIT</license> + <notes> + * [COil] Corrected some indentation problems + * [COil] package.xml, added the changelog section + * [COil] Corrected getBaseDir() private helper + * [COil] Corrected README + * [drashid] package.xml, corrected the problem of installation for symfony 1.2 + </notes> + </release> + </changelog> +</package> \ No newline at end of file
-- You received this message because you are subscribed to the Google Groups "symfony SVN" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-svn?hl=en.
