我要用open-flash-chart-2 做报表,做的是折线图,要求能点击节点触发事件的那种需要用php文件来传输数据,但是为什么我的php文件。老是读取不了,而且就是直接复制官网上面的php文件他也不能读取,下面是我的php文件,希望高手帮忙看看:
白鞋!<?phpinclude 'php-ofc-library/open-flash-chart.php';$data_1 = array();
$data_2 = array();for( $i=0; $i<6.2; $i+=0.2 )
{
$data_1[] = (sin($i) * 1.9) + 7;
$data_2[] = (sin($i) * 1.9) + 10;
}$title = new title( date("D M d Y") );$s = new star();
$s->size(5)->halo_size(2)->on_click("line_1");$line_1 = new line();
$line_1->set_values( $data_1 );
$line_1->set_default_dot_style($s);
$line_1->set_colour( '#EB7600' );
$line_1->set_width( 2 );
$line_1->set_key( "Orange Crush Baby", 10 );$d = new solid_dot();
$d->size(5)->on_click("line_2");$line_2 = new line();
$line_2->set_values( $data_2 );
$line_2->set_default_dot_style($d);
$line_2->set_colour( '#7BED09' );
$line_2->set_width( 1 );
$line_2->set_key( "Green Machine", 10 );$y = new y_axis();
$y->set_range( 0, 15, 5 );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $line_1 );
$chart->add_element( $line_2 );
$chart->set_y_axis( $y );echo $chart->toPrettyString();
?>报的错误是:
Open Flash ChartJSON Parse Error [Syntax Error]
Error at character 0, line 1:0: <?php高手指点,
白鞋!
白鞋!<?phpinclude 'php-ofc-library/open-flash-chart.php';$data_1 = array();
$data_2 = array();for( $i=0; $i<6.2; $i+=0.2 )
{
$data_1[] = (sin($i) * 1.9) + 7;
$data_2[] = (sin($i) * 1.9) + 10;
}$title = new title( date("D M d Y") );$s = new star();
$s->size(5)->halo_size(2)->on_click("line_1");$line_1 = new line();
$line_1->set_values( $data_1 );
$line_1->set_default_dot_style($s);
$line_1->set_colour( '#EB7600' );
$line_1->set_width( 2 );
$line_1->set_key( "Orange Crush Baby", 10 );$d = new solid_dot();
$d->size(5)->on_click("line_2");$line_2 = new line();
$line_2->set_values( $data_2 );
$line_2->set_default_dot_style($d);
$line_2->set_colour( '#7BED09' );
$line_2->set_width( 1 );
$line_2->set_key( "Green Machine", 10 );$y = new y_axis();
$y->set_range( 0, 15, 5 );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $line_1 );
$chart->add_element( $line_2 );
$chart->set_y_axis( $y );echo $chart->toPrettyString();
?>报的错误是:
Open Flash ChartJSON Parse Error [Syntax Error]
Error at character 0, line 1:0: <?php高手指点,
白鞋!
解决方案 »
- PHP如何实现下面的显示方式?????
- 关于open flash chart
- 下面的多维数组,如何把每个数组的第一项合并,第二项合并到一起。。
- vista下为什么取不到http_host?
- 求助!为何使用session就无法在iframe框架中实现自适应高度?
- 新手的问题 为什么在zend编译器中找不到$php_self变量
- 请问如何计算一天内的文章点击率?
- 为了公会,小弟最近正在研究EQdkp系统,是用php编写,本机访问没问题,局域网机器确无法正常访问。
- [在线等!!]急 PHP连接MYSQL数据库 错误!!!
- 微信JS-SDK分享功能突然不好使了
- 高手指教一下,谢谢!!第十行变量错误。
- 在php生成静态html后,怎么就能把html文件也删除呢?
改成
include ('php-ofc-library/open-flash-chart.php');
试试
我的html 如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title><script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart", "550", "200",
"9.0.0", "expressInstall.swf",
{"data-file":"click.php", "id":"my_chart_id"} );
</script><script type="text/javascript">function line_1( chart_id, index )
{
hello( chart_id, 1, index );
}function line_2( chart_id, index )
{
hello( chart_id, 2, index );
}function hello( chart_id, line, index )
{
alert( 'Chart '+chart_id +', hello from line '+ line +' -> '+ index );
}</script></head>
<body>
<div id="my_chart"></div>
</body>
</html>请指教.....
这个文件换成已经静态的文件如xml文件能够正常显示么?
Open Flash ChartJSON Parse Error [Syntax Error]
Error at character 0, line 1:0: <?php
------------------------------------------------
确认你php环境搭配好了么,怎么http返回还能带<?php标签的。
我对php不了解,这是公司项目要求所需,才做的这个,你说的php环境都是什么?我就是按照他们官网上面的一个例子弄下来,
然后就抱着个错,按照正常来说,这个php文件应该被读取生成一个数据文件,但是我试了,他没有生成,现在只能确定的确是php这里出错了,但是到底怎么错的,我还真是一头雾水望指点谢了