Yii 1.1: openflashchart2widget

Widget that renders OpenFlashChart2 objects
13 followers

This extension is a simple wrapper for OpenFlashChart2 objects. It was inspired by the extension YiiOpenFlashChart, but doesn't try to provide a new API to the open flash chart library. Instead, the Widget that comes with this extension takes an object created using open flash chart's PHP language binding. This has the benefit, that this API is already documented, tutorials and examples are available, and the open flash chart community knows the API and can help.

Example: sketch chart

Requirements

I don't know for sure what the minimal requirements are. I developed the extension using Yii 1.1.5, but since it doesn't do anything fancy, I'd guess it will also work with much older versions of Yii.

However, the demo application, that is included in the extension, uses action parameter binding. So this will need at least Yii v1.1.4

Installation

  • Extract folder "OpenFlashChart2Widget" in the release file to protected/extensions
  • Configure your application to find OpenFlashChart2Loader

Usage

First of all, let the OpenFlashChart2Loader initialize everything

OpenFlashChart2Loader::load();

Second, create the open flash chart object using their PHP language binding

$bar = new bar_dome();
$bar->set_values( array(9,8,7,6,5,4,3,2,1) );
 
$chart = new open_flash_chart();
$chart->set_title( new title("MyChart") );
$chart->add_element( $bar );

Third, instantiate the widget and pass the $chart object to it.

$this->widget(
  'application.extensions.OpenFlashChart2Widget.OpenFlashChart2Widget',
  array(
    'chart' => $chart,
    'width' => '100%'
  )
);

Resources

Change Log

November 2, 2011

Configured anonymous read access for the repository containing the widget and the demo

March 27, 2011

Minor Bug fix release - v1.0.1

  • loader doesn't touch php include path any longer
  • demo app validates user input

February 21, 2011

  • Initial release

Total 6 comments

#5415 report it
Tyr84 at 2011/10/10 03:13pm
Pie-Chart

Ben thank you ! I did not try that. Today i download openflashchart2 and i thought that i comment on that page. I didn't even realize that this is widget for openflashchart2 :) I just download it and now i will try to use it. Tnx very much - for now ;)

#5412 report it
Tyr84 at 2011/10/10 11:45am
Pie-Chart

Hello, I try to render pie-chart, but no success. I hope some one of you have knowlage how to do that. Tnx.

#3600 report it
Ben at 2011/04/21 06:57am
feature requests

Hi,

@undsoft: first of all: sorry for not answering for quite some time. I've searched for information about that wmode param, and I think it would be nice to have. However, I also read, that it might cause some trouble (see http://groups.google.com/group/swfobject/msg/412f90e9a96694ec?pli=1). This is why I am not sure if "opaque" should become default or not. Do you have any experience with this?

@aqge: I'm not sure what you mean with saving this offline? About the image export: I know OpenFlashChart2 is capable of exporting a chart to an image (.png). From what I found in the docs, it is possible to post the exported image back to the server (see http://teethgrinder.co.uk/open-flash-chart-2/adv-upload-image.php) using the javascript bindings. This is not exactly what you ask for, but maybe it would be possible to extend the javascript API/ provide a new one, that allows saving the exported image on the client.

#3591 report it
aqge at 2011/04/21 12:58am
downloadble

can you make this saved offline or exported to img perhaps

#3394 report it
undsoft at 2011/04/09 11:01am
Params

Hi,

Thanks for the extension. I think it would be nice to be able to add: { "wmode" : "opaque"
} to params of the widget.

Leave a comment

Please to leave your comment.

Create extension