views:

562

answers:

1

Has anyone found a way to integrate OpenFlashChart v2 with CodeIgniter?

The problem is that the author separated everything in classes and multiple files and you can't create a helper or plugin for CI.

One way to do it using versions prior to 2 is here: link

I haven't found a way to work with version 2 of the chart, has anyone of you found a way?

+1  A: 

for version 2, you just need to generate a javascript json like this one

<script type='text/javascript'>
                    var data =  {"title":{"text":""},"is_decimal_separator_comma":0,"elements":[{"values":[{"value":25000,"label":"AIG Australia 41.67%","highlight":"alpha"},{"value":35000,"label":"Valentino Jr. 58.33%","highlight":"alpha"}],"alpha":0.8,"type":"pie","start-angle":21,"tip":"#val# - #percent#","colours":["#F09B0A","#F03060","#E6FF29","#805B37","#13613A","#aacc44"]}],"num_decimals":2,"is_fixed_num_decimals_forced":0,"is_thousand_separator_disabled":0};
                    $(document).ready(function(){
                        swfobject.embedSWF("/flash/open-flash-chart.swf", "echart", "600","400","9.0.0");
                    });
                    function open_flash_chart_data()
                    {
                            ex = JSON.stringify(data);
                            return ex;
                    }
                </script>

I am using Grails for that , but i think it is same with codeigniter :)

nightingale2k1