• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenFlashChart With CI

#11
[eluser]Lone[/eluser]
I should be posting our OpenFlashChart Library very shortly which should make the integration that bit more easier Smile

#12
[eluser]porksmash[/eluser]
Very cool, post here to let us know where it's at when you do!

#13
[eluser]surfgatinho[/eluser]
Have any of you guys checked this in IE7?
For me it works fine in Firefox, but when I look in IE7 I just get:
"C:\Users\John\Documents\flash\svn\data-files\data-47.txt" which is obviously hard coded somewhere

#14
[eluser]Unknown[/eluser]
Hi,
I've a problem in implementing the Open Flash Chart (the file open-flash-chart-2-hyperion.zip from the official site). Sorry for the too great details in my question, but I don't know as to explain my difficulties in other way.

I made a copy of the following files:

Quote:1) version-2/open-flash-chart.swf in the root of codeigniter

2) version-2/js/swfobject.js in codeigniter/js.

3) version-2/php5-ofc-library/open-flash-chart-object.php in system/application/helpers/ and I renamed this file as open-flash-chart_helper.php

4) version-2/php-ofc-library/open-flash-chart.php in system/application/libraries/ and I renamed this file as graph.php and its class open_flash_chart as graph:

5) because of include_once in the file graph.php, I copied also the other files from version-2/php-ofc-library/ in the same directory where I put the graph.php (system/application/libraries).

Here is the list of the files:

json_format.php
JSON.php
ofc_area_base.php
ofc_area_hollow.php
ofc_area_line.php
ofc_bar_3d.php
ofc_bar_base.php
ofc_bar_filled.php
ofc_bar_glass.php
ofc_bar.php
ofc_bar_sketch.php
ofc_bar_stack.php
ofc_hbar.php
ofc_line_base.php
ofc_line_dot.php
ofc_line_hollow.php
ofc_line.php
ofc_line_style.php
ofc_pie.php
ofc_radar_axis_labels.php
ofc_radar_axis.php
ofc_radar_spoke_labels.php
ofc_scatter_line.php
ofc_scatter.php
ofc_shape.php
ofc_title.php
ofc_tooltip.php
ofc_upload_image.php
ofc_x_axis_label.php
ofc_x_axis_labels.php
ofc_x_axis.php
ofc_x_legend.php
ofc_y_axis_base.php
ofc_y_axis.php
ofc_y_axis_right.php
ofc_y_legend.php


Then I created the controller example.php:

Code:
<?php
class Example extends Controller
{
    function __construct()
    {
        parent::Controller();

        $this->load->helper("open-flash-chart");
        $this->load->library("graph");
    }

    function index()
    {
        $this->load->view("graph_view");
    }

    function chart()
    {
        $label = array('IE','Firefox','Opera','Wii','Other');
        $data = array();
        srand((double)microtime()*1000000);

        for( $i=0; $i<5; $i++ )
        {
            $data[] = rand(5,15);
        }

        $this->graph = new graph();
        $this->graph->pie(60,'#505050','{font-size: 12px; color: #404040;');
        $this->graph->pie_values( $data, $label );
        $this->graph->pie_slice_colours( array('#d01f3c','#356aa0','#C79810') );
        $this->graph->set_tool_tip( '#val#%' );
        $this->graph->title( 'Pie Chart', '{font-size:18px; color: #d01f3c}' );

        $this->graph->render();
    }
}
?&gt;

and the graph_view.php:

Code:
&lt;html&gt;
&lt;body&gt;
    &lt;?= open_flash_chart_object( 500, 250, site_url('example/chart'), false, base_url() ) ?&gt;
&lt;/body&gt;
&lt;/html&gt;

My problem is that when I run http://127.0.0.1/codeigniter/index.php/example I get the loading of flash but no drawings. It seems that the method chart doesn't send to the view the chart settings.

Thank you in advance for any help.

#15
[eluser]Unknown[/eluser]
A bit later but...
Why creating a new object?
Code:
$this->graph = new graph();

Also, I found it easier to implement the older version (1.9.7), without the helper. Just use
Code:
$this->graph->[properties, methods()]
for your charts.

#16
[eluser]dinhtrung[/eluser]
For Open Flash Chart v2, the author separated the php helper files into modules. There's so many classes. Each type of chart has a set of their own classes. So, there's no way to implement them along with CI. The current solution is kept on using OFC v1.9.7 (no further development).
I guest, for drawing chart, that is good enough.

#17
[eluser]Jose Suarez[/eluser]
I havea a problem with swf
Code:
Open Flash Chart
IO ERROR
Loading test data
Error #2032
This is the URL that I tried to open:../../data-files/candle.txt
My controller
Code:
function Welcome()
    {
        parent::Controller();    
        
        $this->load->library('graph');
        $this->load->helper('open_flash_chart');
    }
    
    function index()
    {
        $this->load->view('welcome_message');
    }
    
    function tarta(){
        $cantidad = array('50′,'3′,'8′,'5′);
        $bp_label = array('uno','dos','tres','cuatro');
        $this->graph->pie(80,'#505050′,'{font-size: 12px; color: #404040}');
        $this->graph->pie_values($cantidad,$bp_label);
        $this->graph->pie_slice_colours( array('#d9db35′,'#487daf','#d00000′,'#4ae331′) );
        $this->graph->title('Mi título','{font-size:14px; color: #7F7772}' );
        echo $this->graph->render();
    }
my view
Code:
&lt;html&gt;&lt;head>&lt;/head&gt;&lt;body>
&lt;?=open_flash_chart_object(500,250,site_url('welcome/tarta'),false,base_url())?&gt;
&lt;/body&gt;&lt;/html>

thanks.

#18
[eluser]ch5i[/eluser]
See this post for Open Flash Chart V2 in CI.

cheers,
Thomas

#19
[eluser]tusukgigi[/eluser]
- Copy the php-ofc-library/open-flash-chart.php file to system/application/library/ and then rename it to graph.php

- Copy the open-flash-chart.swf file to assets/swf/

- Copy the js/swfobject.js to assets/js/

- Edit file graph.php, find this following lines :

$this->js_path = 'js/';
$this->swf_path = '';

i not found this line

this is my version of openflashchart

------Open Flash Chart version 1.9.7 -------------


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.