{"id":15547,"date":"2017-01-05T15:07:38","date_gmt":"2017-01-05T09:37:38","guid":{"rendered":"http:\/\/www.fusioncharts.com\/blog\/?p=15547"},"modified":"2026-01-20T14:36:48","modified_gmt":"2026-01-20T09:06:48","slug":"creating-charts-zend-framework-3-fusioncharts-using-database","status":"publish","type":"post","link":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/","title":{"rendered":"Creating Charts with Zend Framework 3 and FusionCharts in 2026"},"content":{"rendered":"In this tutorial, we will be creating JavaScript charts using Zend and FusionCharts using <b>database connectivity<\/b>. Here we will explain everything from installation to the database connectivity, rendering and displaying of the chart in the web browser.\r\n\r\nBefore you move on with this tutorial make sure that you have completed the <a href=\"https:\/\/www.fusioncharts.com\/blog\/2017\/01\/creating-charts-with-zend-and-fusioncharts\/\" target=\"_blank\" rel=\"noopener noreferrer\">Part 1<\/a>(building a static chart using Zend and FusionCharts) of this tutorial series.\r\n\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_71 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Overview\" title=\"Overview\">Overview<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Prerequisites\" title=\"Prerequisites\">Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Introduction_to_Zend_Framework\" title=\"Introduction to Zend Framework\">Introduction to Zend Framework<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Introduction_to_Fusioncharts\" title=\"Introduction to Fusioncharts\">Introduction to Fusioncharts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Step_1_Installing_Zend_Framework_3_and_setting_up_the_project\" title=\"Step 1: Installing  Zend Framework 3 and setting up the project\">Step 1: Installing  Zend Framework 3 and setting up the project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Step_2_Setting_up_the_virtual_host\" title=\"Step 2: Setting up the virtual host\">Step 2: Setting up the virtual host<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#For_Windows_users\" title=\"For Windows users:\">For Windows users:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#For_Linux_LAMP\" title=\"For Linux (LAMP)\">For Linux (LAMP)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Step_3_Installing_Fusioncharts\" title=\"Step 3: Installing Fusioncharts\">Step 3: Installing Fusioncharts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Step_4_Setting_up_the_Database\" title=\"Step 4: Setting up the Database\">Step 4: Setting up the Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Step_5_Creating_a_chart_using_Fusioncharts\" title=\"Step 5: Creating a chart using Fusioncharts\">Step 5: Creating a chart using Fusioncharts<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Setting_up_the_Fusioncharts_module\" title=\"Setting up the Fusioncharts module\">Setting up the Fusioncharts module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Autoloading\" title=\"Autoloading\">Autoloading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Configuration\" title=\"Configuration\">Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Informing_the_application_about_our_new_module\" title=\"Informing the application about our new module\">Informing the application about our new module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Routing_and_controllers\" title=\"Routing and controllers\">Routing and controllers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Creating_the_controller\" title=\"Creating the controller\">Creating the controller<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Setting_up_the_Model\" title=\"Setting up the Model\">Setting up the Model<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Initialise_the_view_scripts\" title=\"Initialise the view scripts\">Initialise the view scripts<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Overview\"><\/span>Overview<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n<ol><li>Introduction to Zend Framework<\/li>\r\n<li>Introduction to Fusioncharts<\/li>\r\n<li>Installing  Zend Framework 3 and Setting up the your Project<\/li>\r\n<li>Setting up the virtual host<\/li>\r\n<li>Installing Fusioncharts<\/li>\r\n<li>Creating a chart with database using Fusioncharts<\/li><\/ol>\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nBefore you move forward with the tutorial you should have a basic understanding of how things work in <b>Zend Framework<\/b>. Click <a href=\"https:\/\/docs.zendframework.com\/tutorials\/getting-started\/overview\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> to get detailed description about the Zend Framework 3.\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Introduction_to_Zend_Framework\"><\/span>Introduction to Zend Framework<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nZend Framework is a cluster of professional PHP packages that can be used to develop web applications and services using PHP 5.6+. It provides 100% object oriented code using a broad spectrum of language features.\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Introduction_to_Fusioncharts\"><\/span>Introduction to Fusioncharts<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nFusionCharts is a comprehensive JavaScript charting library packed with simple and complex charts (like the column and bar charts, pie and doughnut charts, treemap, heatmap, logarithmic charts), gauges and widgets (like the angular gauge, bulb gauge, thermometer gauge, and funnel and pyramid charts), and maps (for all continents, major countries, and all US states).. \r\n\r\nLet\u2019s now get started with the steps for creating a chart with static data using Zend Framework and FusionCharts.\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Step_1_Installing_Zend_Framework_3_and_setting_up_the_project\"><\/span>Step 1: Installing  Zend Framework 3 and setting up the project<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nIn order to build our application, we will start with the <a href=\"https:\/\/github.com\/zendframework\/ZendSkeletonApplication\" target=\"_blank\" rel=\"noopener noreferrer\">ZendSkeletonApplication<\/a> available on github. Use <a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Composer<\/a> to create a new project from scratch, as shown below:\r\n\r\n<pre class=\"lang:powershell\">$ composer create-project -s dev zendframework\/skeleton-application path\/to\/install<\/pre>\r\n\r\nThis will install an initial set of dependencies, which includes:\r\n<ul>\r\n    <li>zend-component-installer, which helps automate the injection of component configuration into your application<\/li>\r\n    <li>zend-mvc, which is the kernel for MVC applications<\/li>\r\n<\/ul>\r\n\r\nIt will ask you a couple of questions which will be regarding the support provided by Zend. You can do <b>y<\/b>(yes) to all the questions or you may acquire them later by simple command:\r\n\r\n<pre class=\"lang:powershell\">$ composer require \"name of the dependency you want\"<\/pre>\r\n\r\nFirst, it will prompt:\r\n\r\n<pre>$ Do you want a minimal install (no optional packages)? Y\/n<\/pre>\r\n\r\nIf you answer with a &#8220;Y&#8221;, or press enter with no selection, the installer will not raise any additional prompts and finish installing your application. If you answer &#8220;n&#8221;, it will continue (for about ten questions) to prompt you with questions.\r\n\r\nNow you can see that there is a <b>skeleton-application<\/b> folder created in the <b>path<\/b> you have specified in the above command. Now you can change the folder name to anything you want , in our case we have renamed the directory skeleton-application to <b>zend_fusioncharts<\/b>.\r\n\r\nOnce done, go inside the directory  that you have set above (In our case the <b>zend_fusioncharts<\/b> ) and run the following command to install all the dependencies:\r\n\r\n<pre class=\"lang:powershell\">$composer self-update\r\n$composer install<\/pre>\r\n\r\nNow the project is completely set. If you\u2019ve followed all the steps correctly, you should see the following output if you traverse to the public folder of your project (localhost\/zend_fusioncharts\/public\/):\r\n\r\n\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Step_2_Setting_up_the_virtual_host\"><\/span>Step 2: Setting up the virtual host<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nFor this project, we are using the Apache Web Server. You can download the Apache web server from <a href=\"https:\/\/httpd.apache.org\/download.cgi\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.\r\n\r\nHere\u2019s how you can set up the virtual-host for your project:\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"For_Windows_users\"><\/span>For Windows users:<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<ol>\r\n    <li>Open <b>C:\\WINDOWS\\system32\\drivers\\etc\\hosts<\/b> in Notepad or a script editor. Look for the following line at the bottom:\r\n    <pre>127.0.0.1   localhost<\/pre><\/li>\r\n    <li>On a separate line, enter <b>127.0.0.1<\/b>, followed by tab space and the name of the virtual host you want to register. For instance, to set up a virtual host called <b>zend_local<\/b>, enter the following:\r\n    <pre>127.0.0.1   zend_local<\/pre><\/li>\r\n    <li>Open <b>httpd.conf<\/b>, the main Apache configuration file, in a text editor. It is in the Apache conf folder. If you&#8217;re using XAMPP, the file is located at C:\\xampp\\apache\\conf\\httpd.conf. Scroll down to the <b>Supplemental configuration<\/b> section at the end, and locate the following section (approximately line no. 500):\r\n    <pre class=\"lang:apacheconf\">#Virtual hosts\r\n#Include conf\/extra\/httpd-vhosts.conf<\/pre><\/li>\r\n    <li>Remove the <b>#<\/b> from the beginning of the second line so the section now looks like this:\r\n    <pre class=\"lang:powershell\">#Virtual hosts\r\nInclude conf\/extra\/httpd-vhosts.conf<\/pre><\/li>\r\n    <li>Save <b>httpd.conf<\/b> and close it.<\/li>\r\n    <li>Open the <b>extra\\httpd-vhosts.conf<\/b> file in Notepad or a text editor. If you&#8217;re using XAMPP, the location is <b>C:\\xampp\\apache\\conf\\extra\\httpd-vhosts.conf<\/b>.<\/li>\r\n    <li>Add a  new virtual host in the <b>vhost.conf<\/b>.\r\n    <pre class=\"lang:apacheconf\">\r\n    ServerAdmin webmaster@dummy.com\r\n    DocumentRoot \"C:\/xampp\/htdocs\/zend_fusioncharts\/public\"\r\n    ServerName zend_local\r\n    ErrorLog \"logs\/dummy-host2.example.com-error.log\"\r\n    CustomLog \"logs\/dummy-host2.example.com-access.log\" common\r\n<\/pre> <\/li>\r\n\r\nThe main section looks like this:\r\n\r\n<a href=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\" alt=\"window\" width=\"620\" height=\"525\" class=\"alignnone size-full wp-image-15554\" srcset=\"\/blog\/wp-content\/uploads\/2017\/01\/window.png 620w, \/blog\/wp-content\/uploads\/2017\/01\/window-150x127.png 150w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a>\r\n    <li>Save the changes made in step 7 <b>httpd-vhosts.conf<\/b>, and restart Apache.<\/li>\r\n    <li>Now you can load your project by writing <strong>https:\/\/zend_local\/<\/strong> in the browser.<\/li>\r\n<\/ol>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"For_Linux_LAMP\"><\/span>For Linux (LAMP)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n<ol>\r\n    <li>Open your terminal and go to <b>\/etc\/apache2\/sites-available\/<\/b>\r\n    <pre class=\"lang:powershell\">$ cd \/etc\/apache2\/sites-available\/<\/pre><\/li>\r\n    <li>Copy the default config (000-default.conf)\r\n    <pre class=\"lang:powershell\">$ sudo cp 000-default.conf zend_local.conf<\/pre><\/li>\r\n    <li>Open the new config file that you have created in <b>step 3<\/b> and edit it to add the following code:\r\n    <pre class=\"lang:apacheconf\">\r\n    ServerAdmin webmaster@localhost\r\n    DocumentRoot \/var\/www\/html\/skeleton\/public\r\n    ServerName zend_local\r\n    SetEnv APPLICATION_ENV \"development\"\r\n\r\n    \r\n    \tDirectoryIndex index.php\r\n    \tAllowOverride All\r\n    \tRequire all granted\r\n\t\r\n\r\n    ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n    CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n<\/pre>\r\n    After you\u2019ve saved all the changes , it should look something like the image given below:\t\r\n    \r\n    <\/li>\r\n    <li>Run the following command\r\n    <pre class=\"lang:powershell\">$ sudo a2ensite example.com.conf<\/pre><\/li>\r\n    <li>Now open the <b>hosts<\/b> file in <b>\/etc\/<\/b> and add the hostname for the website\r\n    <pre class=\"lang:powershell\">$ 127.0.0.1 zend_local<\/pre><\/li>\r\n    <li>Save all the changes and restart the apache server using the command given below:\r\n    <pre class=\"lang:powershell\">$ sudo service apache2 restart<\/pre><\/li>\r\n<\/ol>\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Step_3_Installing_Fusioncharts\"><\/span>Step 3: Installing Fusioncharts<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nYou can download the latest version of FusionCharts Suite XT from <a href=\"https:\/\/www.fusioncharts.com\/download\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. Alternately, you can also install it using the npm or bower package managers, using the commands given below:\r\n\r\nFor npm :\r\n\r\n<pre class=\"lang:powershell\">npm install fusioncharts\r\nnpm install fusionmaps<\/pre>\r\n\r\nFor Bower:\r\n\r\n<pre class=\"lang:powershell\">bower install fusioncharts\r\nbower install fusionmaps<\/pre>\r\n\r\nOnce you have successfully downloaded the FusionCharts Suite XT execute the steps given below to add the FusionCharts library to your project:\r\n\r\n<ol>\r\n<li>Now create a folder named fusioncharts in the public folder of your project.<\/li>\r\n<li>Copy all the files from the js folder of the Fusioncharts XT Suite to the fusioncharts folder in the public directory of your project<\/li>\r\n<li>Download the FusionCharts PHP wrapper to create charts in PHP. You can download it from <a href=\"https:\/\/www.fusioncharts.com\/php-charts\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/li>\r\n<li>After the download is complete and you have extracted all the files copy the fusioncharts.php file. <\/li>\r\n<li>Create a folder Lib in the vendor directory of your project and paste the fusioncharts.php file in the Lib folder.<\/li>\r\n<li>Open a file called layout.phtml (layout.phtml is a default template provided by Zend) in modules \/ Application \/ view \/ layout \/ and add the following lines of code after the other script tags:\r\n<pre class=\"lang:php\">headscript()\r\n-&gt;prependFile($this-&gt;basePath(\u2018fusioncharts\/fusioncharts.js\u2019))\r\n?&gt;<\/pre><\/li>\r\n<\/ol>\r\n\r\nThis completes the installation of FusionCharts.\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Step_4_Setting_up_the_Database\"><\/span>Step 4: Setting up the Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nOpen the file <b>global.php<\/b> and in the zend_fusioncharts\/config\/ and add these lines of code:\r\n\r\n<pre class=\"lang:php\"> [\r\n   \t 'driver' =&gt; 'Pdo',\r\n   \t 'dsn'    =&gt; 'mysql:dbname=FC;host=localhost',\r\n\t],\r\n\t'service_manager' =&gt; [\r\n   \t 'factories' =&gt; [\r\n   \t\t 'Zend\\Db\\Adapter\\Adapter' =&gt; 'Zend\\Db\\Adapter\\AdapterServiceFactory',\r\n   \t ],\r\n\t],\r\n];?&gt;<\/pre>\r\n\r\nCreate a new file called <b>local.php<\/b> in  zend_fusioncharts\/config\/ and add the following code to it:\r\n\r\n<pre class=\"lang:php\"> [\r\n   \t\t 'username' =&gt; 'Your username for mysql connection',\r\n   \t\t 'password' =&gt; 'Your password for mysql connection',\r\n   \t ],\r\n    ];\r\n?&gt;<\/pre>\r\n\r\nNow create a table and insert the following data in the Mysql database.\r\n<pre class=\"lang:sql\">CREATE TABLE albums (id INTEGER PRIMARY KEY AUTO_INCREMENT, month varchar(100) NOT NULL, revenue varchar(100) NOT NULL);\r\nINSERT INTO album (month, revenue) VALUES ('Jan', '4500');\r\nINSERT INTO album (month, revenue) VALUES ('Feb', '4600');\r\nINSERT INTO album (month, revenue) VALUES ('Mar', '4800');\r\nINSERT INTO album (month, revenue) VALUES ('Apr', '4500');\r\nINSERT INTO album (month, revenue) VALUES ('May', '4700');\r\nINSERT INTO album (month, revenue) VALUES ('June', '3500');\r\nINSERT INTO album (month, revenue) VALUES ('July', '4500');\r\nINSERT INTO album (month, revenue) VALUES ('Aug', '4100');\r\nINSERT INTO album (month, revenue) VALUES ('Sep', '4200');\r\nINSERT INTO album (month, revenue) VALUES ('Oct', '4500');\r\nINSERT INTO album (month, revenue) VALUES ('Nov', '4000');\r\nINSERT INTO album (month, revenue) VALUES ('Dec', '5500');<\/pre>\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Step_5_Creating_a_chart_using_Fusioncharts\"><\/span>Step 5: Creating a chart using Fusioncharts<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Setting_up_the_Fusioncharts_module\"><\/span>Setting up the Fusioncharts module<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nStart by creating a directory called Fusioncharts under <b>module<\/b> with the following sub-directories to hold the module\u2019s files:\r\n\r\n\r\n\r\nLet&#8217;s create <b>Module.php<\/b> file now, with the following contents:\r\n\r\n<pre class=\"lang:php\"> [\r\n   \t\t\t Model\\FusionchartsTable::class =&gt; function($container){\r\n   \t\t\t\t $tableGateway = $container-&gt;get(Model\\FusionchartsTableGateway::class);\r\n   \t\t\t\t return new Model\\FusionchartsTable($tableGateway);\r\n   \t\t\t },\r\n   \t\t\t Model\\FusionchartsTableGateway::class =&gt; function($container){\r\n   \t\t\t\t $dbAdapter = $container-&gt;get(AdapterInterface::class);\r\n   \t\t\t\t $resultSetPrototype = new ResultSet();\r\n   \t\t\t\t $resultSetPrototype-&gt;setArrayObjectPrototype(new Model\\Fusioncharts());\r\n        \treturn new TableGateway('Albums', $dbAdapter, null, $resultSetPrototype);\r\n   \t\t\t }\r\n   \t\t ],\r\n   \t ];\r\n\t}\r\n\r\n\tpublic function getControllerConfig()\r\n\t{\r\n    \treturn [\r\n        \t'factories' =&gt; [\r\n            \tController\\FusionchartsController::class =&gt; function($container) {\r\n                \treturn new Controller\\FusionchartsController(\r\n                    \t$container-&gt;get(Model\\FusionchartsTable::class)\r\n                \t);\r\n            \t},\r\n        \t],\r\n    \t];\r\n\t}\r\n}\r\n?&gt;<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Autoloading\"><\/span>Autoloading<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nOpen <b>composer.json<\/b> in your project root, and look for the <b>autoload<\/b> section; it should look like the following by default:\r\n\r\n<pre class=\"lang:php\">\"autoload\": {\r\n    \"psr-4\": {\r\n        \"Application\\\\\": \"module\/Application\/src\/\"\r\n    }\r\n},<\/pre>\r\n\r\nWe&#8217;ll now add our new module to the list, so it now reads:\r\n\r\n<pre class=\"lang:php\">\"autoload\": {\r\n    \"psr-4\": {\r\n        \"Application\\\\\": \"module\/Application\/src\/\",\r\n        \"Fusioncharts\\\\\": \"module\/Fusioncharts\/src\/\"\r\n    }\r\n},<\/pre>\r\n\r\nOnce you&#8217;ve made that change, run the following to ensure Composer updates its autoloading rules:\r\n\r\n<pre>$ composer dump-autoload<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Configuration\"><\/span>Configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nCreate a file called <b>module.config.php<\/b> under zend_fusioncharts\/module\/Fusioncharts\/config\/:\r\n\r\n<pre class=\"lang:php\">namespace Fusioncharts;\r\n\r\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\r\n\r\nreturn [\r\n    'controllers' =&gt; [\r\n        'factories' =&gt; [\r\n            Controller\\FusionchartsController::class =&gt; InvokableFactory::class,\r\n        ],\r\n    ],\r\n    'view_manager' =&gt; [\r\n        'template_path_stack' =&gt; [\r\n            'album' =&gt; __DIR__ . '\/..\/view',\r\n        ],\r\n    ],\r\n];<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Informing_the_application_about_our_new_module\"><\/span>Informing the application about our new module<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nWe now need to tell the <b>ModuleManager<\/b> that this new module exists. This is done in the application\u2019s config\/modules.config.php file which is provided by the skeleton application.\r\n\r\n<pre class=\"lang:php\">return [\r\n    'Zend\\Form',\r\n    'Zend\\Db',\r\n    'Zend\\Router',\r\n    'Zend\\Validator',\r\n    'Application',\r\n    'Fusioncharts',\r\n];<\/pre>\r\n\r\n<b>Note:<\/b> `Fusioncharts` has been added to the above code \r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Routing_and_controllers\"><\/span>Routing and controllers<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nThe mapping of a URL to a particular action is done using routes that are defined in the module\u2019s <b>module.config.php<\/b> file. \r\nSo now update the  file module.config.php in the config  folder of your module.\r\n\r\n<pre class=\"lang:php\">&gt;namespace Fusioncharts;\r\n\r\nuse Zend\\Router\\Http\\Segment;\r\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\r\n\r\nreturn [\r\n    'controllers' =&gt; [\r\n        'factories' =&gt; [\r\n            Controller\\FusionchartsController::class =&gt; InvokableFactory::class,\r\n        ],\r\n    ],\r\n\r\n    \/\/ The following section is new and should be added to your file:\r\n    'router' =&gt; [\r\n        'routes' =&gt; [\r\n            'fusioncharts' =&gt; [\r\n                'type'    =&gt; Segment::class,\r\n                'options' =&gt; [\r\n                    'route' =&gt; '\/fusioncharts[\/:action[\/:id]]',\r\n                    'constraints' =&gt; [\r\n                        'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',\r\n                        'id'     =&gt; '[0-9]+',\r\n                    ],\r\n                    'defaults' =&gt; [\r\n                        'controller' =&gt; Controller\\FusionchartsController::class,\r\n                        'action'     =&gt; 'index',\r\n                    ],\r\n                ],\r\n            ],\r\n        ],\r\n    ],\r\n\r\n    'view_manager' =&gt; [\r\n        'template_path_stack' =&gt; [\r\n            'fusioncharts' =&gt; __DIR__ . '\/..\/view',\r\n        ],\r\n    ],\r\n];<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Creating_the_controller\"><\/span>Creating the controller<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nWe are now ready to set up our controller. \r\n\r\nFor zend-mvc, the controller is a class that is generally called <b>{Controller name}Controller<\/b>; note that the controller\u2019s name must start with a capital letter. The controller class lives in a file called <b>{Controller name}Controller.php<\/b> within the Controller subdirectory for the module; in our case it is <b>module\/Fusioncharts\/src\/Controller\/<\/b>. Each action is a public method within the controller class that is named as <b>{action name}Action<\/b>, where {action name} should start with a lowercase letter.\r\n\r\nNext, to use Fusioncharts in that Controller you need to include the fusioncharts.php wrapper in this file.\r\n\r\nLet\u2019s go ahead and create our controller class in the file <b>zend_fusioncharts\/module\/Fusioncharts\/src\/Controller\/FusionchartsController.php<\/b>:\r\n\r\n<pre class=\"lang:php\">table = $table;\r\n\t}\r\n   \r\n\t\/\/Used to the index action which will render index.phtml that has a chart with static data\r\n\t\/\/ link -&gt; __ServerName__\/fusioncharts\/index or __ServerName__\/fusioncharts\/index\r\n\tpublic function indexAction()\r\n\t{\r\n   \r\n\t}\r\n    \r\n\t\/\/Used to the index action which will render index.phtml that has a chart with data returned from the database\r\n\t\/\/link -&gt; __ServerName__\/fusioncharts\/db\/\r\n\tpublic function dbAction()\r\n\t{   \r\n    \treturn new ViewModel([\r\n        \t'albums' =&gt; $this-&gt;table-&gt;fetchAll(),\r\n    \t]);\r\n\t}   \r\n}    \r\n?&gt;<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Setting_up_the_Model\"><\/span>Setting up the Model<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nLet&#8217;s start by creating a file called <b>Fusioncharts.php<\/b> under the directory module\/Fusioncharts\/src\/Model and populate it with the code given below:\r\n\r\n<pre class=\"lang:php\">namespace Fusioncharts\\Model;\r\n\r\nclass Fusioncharts\r\n{\r\n    public $id;\r\n    public $artist;\r\n    public $title;\r\n\r\n    public function exchangeArray(array $data)\r\n    {\r\n        $this-&gt;id     = !empty($data['id']) ? $data['id'] : null;\r\n        $this-&gt;artist = !empty($data['artist']) ? $data['artist'] : null;\r\n        $this-&gt;title  = !empty($data['title']) ? $data['title'] : null;\r\n    }\r\n}<\/pre>\r\n\r\nNext, create a file called <b>FusionchartsTable.php<\/b> under the module\/Fusioncharts\/src\/Model directory and populate it with the code given below:\r\n\r\n<pre class=\"lang:php\">namespace Fusioncharts\\Model;\r\n\r\nuse RuntimeException;\r\nuse Zend\\Db\\TableGateway\\TableGatewayInterface;\r\n\r\nclass FusionchartsTable\r\n{\r\n    private $tableGateway;\r\n    public function __construct(TableGatewayInterface $tableGateway)\r\n    {\r\n        $this-&gt;tableGateway = $tableGateway;\r\n    }\r\n    public function fetchAll()\r\n    {\r\n        return $this-&gt;tableGateway-&gt;select();\r\n    }\r\n}<\/pre>\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Initialise_the_view_scripts\"><\/span>Initialise the view scripts<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\nTo integrate the view into our application, we need to create some view script files. These files will be executed by the <b>DefaultViewStrategy<\/b> and will be passed any variables or view models that are returned from the controller action method. \r\n\r\nSo now create a file called <b>db.phtml<\/b> in   modules\/Fusioncharts\/view\/fusioncharts\/fusioncharts\/db.phtml \r\nAnd add the following code:\r\n\r\n<pre class=\"lang:php\"> $album-&gt;month , \"value\" =&gt; $album-&gt;revenue];\r\n    \tarray_push($datas, $data) ;\r\n\t}\r\n\r\n\t\/\/Call the Fusioncharts Class to render the chart\r\n\t$columnChart = new FusionCharts(\"column2d\", \"myFirstChart1\" , 600, 300, \"chart 2\", \"json\",\r\n    \t'{\r\n        \t\"chart\": {\r\n            \t\"caption\": \"Quarterly Revenue\",\r\n            \t\"subCaption\": \"Last year\",\r\n            \t\"xAxisName\": \"Quarter\",\r\n            \t\"yAxisName\": \"Amount (In USD)\",\r\n            \t\"theme\": \"fint\",\r\n            \t\"numberPrefix\": \"$\",\r\n            \t\/\/Setting the usage of plot gradient\r\n            \t\"usePlotGradientColor\": \"1\",\r\n            \t\/\/Custom plot gradient color\r\n            \t\"plotGradientColor\": \"#eeeeee\"\r\n        \t},\r\n        \t\"data\": '.json_encode($datas).'\r\n    \t}'\r\n\t);\r\n\t\/\/Rendering Chart\r\n\t$columnChart-&gt;render();     \t \r\n?&gt;\r\n\r\n<div id=\"chart 2\">Fusion Charts will render here<\/div><\/pre>\r\n\r\nAfter this is done you are good to go this url https:\/\/zend_local\/fusioncharts\/db you\u2019ll get :\r\n\r\n<a href=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2016\/11\/screenshot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2016\/11\/screenshot.png\" alt=\"screenshot\" width=\"607\" height=\"363\" class=\"alignnone size-full wp-image-15509\" srcset=\"\/blog\/wp-content\/uploads\/2016\/11\/screenshot.png 607w, \/blog\/wp-content\/uploads\/2016\/11\/screenshot-150x90.png 150w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/a>\r\n\r\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\nThis was the complete step-by-step process for creating a chart using the Zend Framework with FusionCharts, using database. If you have completed the tutorial and want to recall the same steps of creating charts using static data, you can move on to the first part, which talks about <a href=\"https:\/\/www.fusioncharts.com\/blog\/2017\/01\/creating-charts-with-zend-and-fusioncharts\/\" target=\"_blank\" rel=\"noopener noreferrer\">creating charts using Zend and Fusioncharts with static data<\/a>.\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will be creating JavaScript charts using Zend and FusionCharts using database connectivity. Here we will explain everything from installation to the database connectivity, rendering and displaying of the chart in the web browser. Before you move on with this tutorial make sure that you have completed the Part 1(building a static [&hellip;]<\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[152,600,602,603],"coauthors":[647],"class_list":["post-15547","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-fusioncharts","tag-zend","tag-zend-framework-and-fusioncharts","tag-zend-framework-and-fusioncharts-using-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating Charts with Zend Framework 3 and FusionCharts in 2026<\/title>\n<meta name=\"description\" content=\"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Charts with Zend Framework 3 and FusionCharts in 2026\" \/>\n<meta property=\"og:description\" content=\"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\" \/>\n<meta property=\"og:site_name\" content=\"FusionBrew - The FusionCharts Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-05T09:37:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T09:06:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/01\/window.png\" \/>\n\t<meta property=\"og:image:width\" content=\"620\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dishank Tiwari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dishank Tiwari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\/\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"Article\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Dishank Tiwari\",\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/9106ebef0b6b4fec8a2bb46862ee02ad\"\n\t            },\n\t            \"headline\": \"Creating Charts with Zend Framework 3 and FusionCharts in 2026\",\n\t            \"datePublished\": \"2017-01-05T09:37:38+00:00\",\n\t            \"dateModified\": \"2026-01-20T09:06:48+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\"\n\t            },\n\t            \"wordCount\": 1581,\n\t            \"commentCount\": 4,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\",\n\t            \"keywords\": [\n\t                \"FusionCharts\",\n\t                \"zend\",\n\t                \"zend framework and fusioncharts\",\n\t                \"zend framework and fusioncharts using database\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Tutorials\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\",\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\",\n\t            \"name\": \"Creating Charts with Zend Framework 3 and FusionCharts in 2026\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\",\n\t            \"datePublished\": \"2017-01-05T09:37:38+00:00\",\n\t            \"dateModified\": \"2026-01-20T09:06:48+00:00\",\n\t            \"description\": \"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.\",\n\t            \"breadcrumb\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#breadcrumb\"\n\t            },\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage\",\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\",\n\t            \"contentUrl\": \"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png\"\n\t        },\n\t        {\n\t            \"@type\": \"BreadcrumbList\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#breadcrumb\",\n\t            \"itemListElement\": [\n\t                {\n\t                    \"@type\": \"ListItem\",\n\t                    \"position\": 1,\n\t                    \"name\": \"Home\",\n\t                    \"item\": \"https:\/\/www.fusioncharts.com\/blog\/\"\n\t                },\n\t                {\n\t                    \"@type\": \"ListItem\",\n\t                    \"position\": 2,\n\t                    \"name\": \"Creating Charts with Zend Framework 3 and FusionCharts in 2026\"\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#website\",\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/\",\n\t            \"name\": \"FusionBrew - The FusionCharts Blog\",\n\t            \"description\": \"Get tips and tricks on how to build effective Data Visualisation using FusionCharts\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\/\/www.fusioncharts.com\/blog\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#organization\",\n\t            \"name\": \"FusionCharts\",\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/logo\/image\/\",\n\t                \"url\": \"\/blog\/wp-content\/uploads\/2020\/03\/idera-fc-logo.svg\",\n\t                \"contentUrl\": \"\/blog\/wp-content\/uploads\/2020\/03\/idera-fc-logo.svg\",\n\t                \"width\": 1,\n\t                \"height\": 1,\n\t                \"caption\": \"FusionCharts\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/logo\/image\/\"\n\t            }\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/9106ebef0b6b4fec8a2bb46862ee02ad\",\n\t            \"name\": \"Dishank Tiwari\",\n\t            \"image\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/image\/edab16f3ae97d48c528d1820c0597954\",\n\t                \"url\": \"\/blog\/wp-content\/wphb-cache\/gravatar\/589\/58951cd49296e6fe39049faab4be5f7cx96.jpg\",\n\t                \"contentUrl\": \"\/blog\/wp-content\/wphb-cache\/gravatar\/589\/58951cd49296e6fe39049faab4be5f7cx96.jpg\",\n\t                \"caption\": \"Dishank Tiwari\"\n\t            },\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/author\/dishank-tiwari\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating Charts with Zend Framework 3 and FusionCharts in 2026","description":"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/","og_locale":"en_US","og_type":"article","og_title":"Creating Charts with Zend Framework 3 and FusionCharts in 2026","og_description":"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.","og_url":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/","og_site_name":"FusionBrew - The FusionCharts Blog","article_published_time":"2017-01-05T09:37:38+00:00","article_modified_time":"2026-01-20T09:06:48+00:00","og_image":[{"width":620,"height":525,"url":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/01\/window.png","type":"image\/png"}],"author":"Dishank Tiwari","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dishank Tiwari","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#article","isPartOf":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/"},"author":{"name":"Dishank Tiwari","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/9106ebef0b6b4fec8a2bb46862ee02ad"},"headline":"Creating Charts with Zend Framework 3 and FusionCharts in 2026","datePublished":"2017-01-05T09:37:38+00:00","dateModified":"2026-01-20T09:06:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/"},"wordCount":1581,"commentCount":4,"publisher":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png","keywords":["FusionCharts","zend","zend framework and fusioncharts","zend framework and fusioncharts using database"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/","url":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/","name":"Creating Charts with Zend Framework 3 and FusionCharts in 2026","isPartOf":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage"},"image":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png","datePublished":"2017-01-05T09:37:38+00:00","dateModified":"2026-01-20T09:06:48+00:00","description":"Create 2026 JavaScript charts using Zend and FusionCharts. Master database connectivity and explanation in our tutorial. Build robust Zend applications now.","breadcrumb":{"@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#primaryimage","url":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png","contentUrl":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/gallery\/blog\/2017\/01\/window.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fusioncharts.com\/blog\/creating-charts-zend-framework-3-fusioncharts-using-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fusioncharts.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating Charts with Zend Framework 3 and FusionCharts in 2026"}]},{"@type":"WebSite","@id":"https:\/\/www.fusioncharts.com\/blog\/#website","url":"https:\/\/www.fusioncharts.com\/blog\/","name":"FusionBrew - The FusionCharts Blog","description":"Get tips and tricks on how to build effective Data Visualisation using FusionCharts","publisher":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fusioncharts.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.fusioncharts.com\/blog\/#organization","name":"FusionCharts","url":"https:\/\/www.fusioncharts.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/logo\/image\/","url":"\/blog\/wp-content\/uploads\/2020\/03\/idera-fc-logo.svg","contentUrl":"\/blog\/wp-content\/uploads\/2020\/03\/idera-fc-logo.svg","width":1,"height":1,"caption":"FusionCharts"},"image":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/9106ebef0b6b4fec8a2bb46862ee02ad","name":"Dishank Tiwari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/image\/edab16f3ae97d48c528d1820c0597954","url":"\/blog\/wp-content\/wphb-cache\/gravatar\/589\/58951cd49296e6fe39049faab4be5f7cx96.jpg","contentUrl":"\/blog\/wp-content\/wphb-cache\/gravatar\/589\/58951cd49296e6fe39049faab4be5f7cx96.jpg","caption":"Dishank Tiwari"},"url":"https:\/\/www.fusioncharts.com\/blog\/author\/dishank-tiwari\/"}]}},"_links":{"self":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/posts\/15547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/comments?post=15547"}],"version-history":[{"count":0,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/posts\/15547\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/media?parent=15547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/categories?post=15547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/tags?post=15547"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/coauthors?post=15547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}