 |
ช่วยหน่อย ครับ fusionchart ทำไม สร้าง กราฟ เส้นไม่ได้ หรือมี เวอร์ชั่น ไหน ที่สามารถสร้างกราฟ เส้น ได้ ครับ |
|
 |
|
|
 |
 |
|
ถามซะหว่านแห เลย เอา code มาลงด้วยสิครับ
|
 |
 |
 |
 |
Date :
2013-11-26 21:01:06 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2013-11-27 05:52:50 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำตามตัวอย่าง เว็ปนี้ ครับ http://phpdream.blogspot.com/2008/05/fusionchartphpmysql-step.html
แต่ไม่มีกราฟเส้น ทำได้ 2 กราฟ คือ กราฟแท่ง กับ กราฟวงกลม ที่อยากได้ คือ กราฟ เส้น ครับ ผม download ไฟล์ ทั้งหมด ใน เว็บนี้ครับ
Code (PHP)
<?php
//We've included ../Includes/FusionCharts.php and ../Includes/DBConn.php, which contains
//functions to help us easily embed the charts and connect to a database.
include("../Includes/FusionCharts.php");
include("../Includes/DBConn.php");
?>
<HTML>
<HEAD>
<TITLE>
</TITLE>
<?php
//You need to include the following JS file, if you intend to embed the chart using JavaScript.
//Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer
//When you make your own charts, make sure that the path to this JS file is correct. Else, you would get JavaScript errors.
?>
<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.text{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
color: #333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333;
}
a:hover {
text-decoration: none;
color: #333;
}
a:active {
text-decoration: none;
color: #333;
}
.as {
font-size: 14px;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<CENTER>
<h2>Or</h2>
<p>
<?php
//In this example, we show how to connect FusionCharts to a database.
//For the sake of ease, we've used an MySQL databases containing two
//tables.
// Connect to the DB
$link = connectToDB();
//We also keep a flag to specify whether we've to animate the chart or not.
//If the user is viewing the detailed chart and comes back to this page, he shouldn't
//see the animation again.
$animateChart = $_GET['animate'];
//Set default value of 1
if ($animateChart=="")
$animateChart = "1";
//$strXML will be used to store the entire XML document generated
//Generate the chart element
$strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' cm' animation=' " . $animateChart . "'>";
// Fetch all factory records
// $strQuery = "select * from Factory_Master";
// $result = mysql_query($strQuery) or die(mysql_error());
//WHERE status !=2
$strQuery = "select distinct(gen) as type_name , sum(new) as count_amt from size_1 group by type_name";
$result2 = mysql_query($strQuery) or die(mysql_error());
//Iterate through each factory
if ($result2) {
while($ors2 = mysql_fetch_array($result2)) {
$strXML .= "<set label='" . $ors2['type_name'] . "' value='" . $ors2['count_amt'] . "' />";
}
}
mysql_close($link);
//Finally, close <chart> element
$strXML .= "</chart>";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../../FusionCharts/Column3D.swf", "", $strXML, "FactorySum", 600, 300, false, false);
// echo renderChart("../../FusionCha rts/Pie3D.swf", "", $strXML, "FactorySum", 600, 300, false, false);
?>
</p><br>
</CENTER>
</BODY>
</HTML>
|
 |
 |
 |
 |
Date :
2013-11-27 14:19:01 |
By :
Aun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จากเว็บนั้น...
ตรง Post a Comment ทำไมไม่โพสต์ถามคนเขียนละครับ
เค้าน่าจะช่วยได้นะ 
|
 |
 |
 |
 |
Date :
2013-11-27 14:36:06 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
echo renderChart("../../FusionCharts/Column3D.swf",
ลองไปดูใน ../../FusionCharts/ ว่าเค้ามี chart อะไรให้เล่นบ้าง จะได้ไม่ต้องมานั่งสงสัย ว่าทำไมอันนั้นมี อันนี้ไม่มี
|
 |
 |
 |
 |
Date :
2013-11-29 08:42:17 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|