将数据保存到xml文件

时间:2016-09-02 07:26:17

标签: php codeigniter fusioncharts

我使用fusioncharts生成图表。使用xml文件生成图表。但无法生成xml文件。

$colone ="";

$open_vals = "<chart  caption='Referrals' labelDisplay='Rotate' showBorder='0' showLegend ='1' showPlotBorder='0' bgColor = '#FFFFFF' plotGradientColor='#274F95' canvasBorderThickness ='0' canvasBorderColor = '#FFFFFF' numberPrefix='' formatNumberScale='0' exportEnabled='1' exportAction='Save' exportAtClient='0'>";

    $colone .= "<set label='" . $readmit_values['label'] . "' value='" .$readmit_values['value']. "' color='#274F95' />";
        $close_vals ="</chart>";
        $xml_file_content = $open_vals.$colone.$close_vals;
        $pick_time = time();
        $file_name = 'dashboard_'.$pick_time;
        $store_path = '/dashboard'.'/'.$file_name.'.xml';

        write_file($store_path, $xml_file_content);

0 个答案:

没有答案