fusioncharts / php-wrapper Goto Github PK
View Code? Open in Web Editor NEWPHP Module for FusionCharts JavaScript Charting Library
Home Page: https://www.fusioncharts.com/explore/integrations/back-end-integrations/php
License: MIT License
PHP Module for FusionCharts JavaScript Charting Library
Home Page: https://www.fusioncharts.com/explore/integrations/back-end-integrations/php
License: MIT License
you put the wrong example of php code of Loading data from MySQL here on this page: http://www.fusioncharts.com/php-charts/
There is an opened if statement with no close braces. Update your website.
Could you provide the wrapper as a PHP library using a Composer package?
https://getcomposer.org/doc/01-basic-usage.md
https://packagist.org/about
Hello All
I am trying to practice with "Creating Charts with Data from a Database"
I am getting the "Chart type not supported" error when I run the code.
I just changed the namedb and script "fusioncharts.js" by adding type.
What could be the problem?
Thanks in advance!
There is my code:
connect_error) { exit("There was an error with your connection: ".$dbhandle->connect_error); } ?> <title>FusionCharts XT - Column 2D Chart - Data from a database</title><!-- You need to include the following JS file to render the chart.
When you make your own charts, make sure that the path to this JS file is correct.
Else, you will get JavaScript errors. -->
<script type="text/javascript" src="fusioncharts.js"></script>
// Form the SQL query that returns the top 10 most populous countries
$strQuery = "SELECT Name, Population FROM Country ORDER BY Population DESC LIMIT 10";
// Execute the query, or else return the error message.
$result = $dbhandle->query($strQuery) or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}");
// If the query returns a valid response, prepare the JSON string
if ($result) {
// The `$arrData` array holds the chart attributes and data
$arrData = array(
"chart" => array(
"caption" => "Top 10 Most Populous Countries",
"paletteColors" => "#0075c2",
"bgColor" => "#ffffff",
"borderAlpha"=> "20",
"canvasBorderAlpha"=> "0",
"usePlotGradientColor"=> "0",
"plotBorderAlpha"=> "10",
"showXAxisLine"=> "1",
"xAxisLineColor" => "#999999",
"showValues" => "0",
"divlineColor" => "#999999",
"divLineIsDashed" => "1",
"showAlternateHGridColor" => "0"
)
);
$arrData["data"] = array();
// Push the data into the array
while($row = mysqli_fetch_array($result)) {
array_push($arrData["data"], array(
"label" => $row["Name"],
"value" => $row["Population"]
)
);
}
/*JSON Encode the data to retrieve the string containing the JSON representation of the data in the array. */
$jsonEncodedData = json_encode($arrData);
/*Create an object for the column chart using the FusionCharts PHP class constructor. Syntax for the constructor is ` FusionCharts("type of chart", "unique chart id", width of the chart, height of the chart, "div id to render the chart", "data format", "data source")`. Because we are using JSON data to render the chart, the data format will be `json`. The variable `$jsonEncodeData` holds all the JSON data for the chart, and will be passed as the value for the data source parameter of the constructor.*/
$columnChart = new FusionCharts("column2D", "myFirstChart" , 600, 300, "chart-1", "json", $jsonEncodedData);
// Render the chart
$columnChart->render();
// Close the database connection
$dbhandle->close();
}
?>
<div id="chart-1"><!-- Fusion Charts will render here--></div>
i using it in my local server try to remove FusionCharts XT Trial lable but cant. Please help me out
I had use this code:
<script type="text/javascript" src="js/fusioncharts.js"></script> <script type="text/javascript" src="js/themes/fusioncharts.theme.ocean.js"></script> render(); ?>Got the following error.
There is an issue (#6) from 2019 requesting Composer support, which was never implemented.
Could we please revisit this super low hanging fruit request?
It appears you guys already have a Packagist account (https://packagist.org/packages/fusioncharts/), so it should be really simple to add this repo as well.
Thanks for the consideration.
I have downloaded every neccessaries documents and connect them according to the instructions. however, when I load my browser, it show an empty page.
I want to fetch data from mysql database .
Thanks
And getting an error:
fusioncharts.js:77
Uncaught Error: #03091456 ex1.render() Error >> Unable to find the container DOM element.
at C.core.render (fusioncharts.js:77)
at Function. (test.php:45)
at fusioncharts.js:47
Thoughts?
Hello,
I have all the required files, the latest engine and themes and js files loaded.
yet the page still displays blank with the examples you have provided.
Any help is greatly appreciated.
Hi,
It seems the PHP wrapper has been renewed. The old one had options for setting the 'containerBackgroundOpacity' and adding styles, this one doesn't. More might be missing, which I haven't noticed yet.
Any plan on making the PHP wrapper more complete? (the wrapper might be open source, but it is needed for a product that I bought).
My php version is above 5, when is tried the sample code chart is nt appearing with error as "chart type is not supported" please tell me the solution.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.