{"id":16474,"date":"2017-11-09T12:31:30","date_gmt":"2017-11-09T07:01:30","guid":{"rendered":"http:\/\/www.fusioncharts.com\/blog\/?p=16474"},"modified":"2019-07-23T00:26:21","modified_gmt":"2019-07-22T18:56:21","slug":"create-charts-php-cassandra","status":"publish","type":"post","link":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/","title":{"rendered":"Creating Interactive Charts With PHP And Cassandra"},"content":{"rendered":"Apache Cassandra is a distributed database with unique benefits which should ideally be present in the developer&#8217;s toolkit. Cassandra is free and open-source distributed database management system which is designed to manage very large amount of structured data.\r\n\r\nIn this article, we\u2019ll discuss the step-by-step process of creating charts by fetching chart data from a Cassandra database. For this, we will use FusionCharts, a JavaScript-charting library and its PHP wrapper.\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 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#Requirements\" title=\"Requirements:\">Requirements:<\/a><\/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\/create-charts-php-cassandra\/#Step_1_Establishing_and_Verifying_Connection_with_Database\" title=\"Step 1: Establishing and Verifying Connection with Database\">Step 1: Establishing and Verifying Connection with Database<\/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\/create-charts-php-cassandra\/#Step_2_Fetching_Data_and_Forming_JSON_Array\" title=\"Step 2: Fetching Data and Forming JSON Array\">Step 2: Fetching Data and Forming JSON Array<\/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\/create-charts-php-cassandra\/#Step_3_Creating_the_Chart_Container\" title=\"Step 3: Creating the Chart Container\">Step 3: Creating the Chart Container<\/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\/create-charts-php-cassandra\/#Step_4_Creating_a_Chart_Instance_and_Rendering_the_Chart\" title=\"Step 4: Creating a Chart Instance and Rendering the Chart\">Step 4: Creating a Chart Instance and Rendering the Chart<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Requirements\"><\/span>Requirements:<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTo render charts in PHP, we need three components, as listed below:\r\n\r\nFusionCharts Core Package JS Files [<a href=\"https:\/\/www.fusioncharts.com\/download\/\" target=\"_blank\" rel=\"noopener noreferrer\">Download Link<\/a>]\r\nFusionCharts PHP Wrapper [<a href=\"https:\/\/www.fusioncharts.com\/php-charts\/\" target=\"_blank\" rel=\"noopener noreferrer\">Download Link<\/a>]\r\nPHP Driver for Apache Cassandra [<a href=\"https:\/\/downloads.datastax.com\/php-driver\/\" target=\"_blank\" rel=\"noopener noreferrer\">Download Link<\/a>]\r\n\r\n<strong>Including FusionCharts Core JS Files<\/strong>\r\n\r\nTo include FusionCharts core packages (<code>fusioncharts.js<\/code> and <code>fusioncharts.charts.js<\/code>) in the HTML file, refer to the code below:\r\n<pre class=\"lang:markup decode:true \">&lt;html&gt;\r\n  &lt;head&gt;\r\n     &lt;!-- including FusionCharts core package JS files --&gt;\r\n     &lt;script src=\"path\/to\/fusioncharts.js\"&gt;&lt;\/script&gt;\r\n     &lt;script src=\"path\/to\/fusioncharts.charts.js\"&gt;&lt;\/script&gt;\r\n  &lt;\/head&gt;\r\n&lt;\/html&gt;<\/pre>\r\n<strong>Including FusionCharts PHP Wrapper<\/strong>\r\n\r\nRefer to the code below to include FusionCharts PHP wrapper (<code>fusioncharts.php<\/code>) in your PHP code.\r\n<pre class=\"lang:php decode:true \">&lt;?php\r\n  \/\/ including FusionCharts PHP wrapper\r\n  include(\"path\/to\/fusioncharts.php\");\r\n?&gt;<\/pre>\r\nOnce done, you are all set with the environment in your system to work with Cassandra database.\r\n<h2><span class=\"ez-toc-section\" id=\"Step_1_Establishing_and_Verifying_Connection_with_Database\"><\/span>Step 1: Establishing and Verifying Connection with Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nEstablish the connection with Cassandra database to fetch data for the chart. Refer to the PHP code below:\r\n<pre class=\"lang:php decode:true \">$cluster = Cassandra::cluster()-&gt;build();\r\n\r\n$keyspace = 'marathons';\r\n\r\n\/\/ creating session with cassandra scope by keyspace\r\n$session = $cluster-&gt;connect($keyspace);\r\n\r\n\/\/ verifying connection with database\r\nif(!$session) { echo \"Error - Unable to connect to database\"; }\r\n<\/pre>\r\nIn the above code:\r\n<ul>\r\n \t<li><code>Cassandra::cluster()-&gt;build();<\/code> will by default establish connection with localhost cluster. You can also specify remote URL to establish connection with remote cluster. <code>withContactPoints()<\/code> and <code>withPort()<\/code> methods are used to specify IP addresses or hostnames, and port number of the nodes in a given Cassandra cluster. Refer to this <a href=\"https:\/\/docs.datastax.com\/en\/developer\/php-driver\/1.3\/features\/#specifying-addresses-of-cassandra-nodes\">link<\/a> for more details.<\/li>\r\n \t<li><code>$keyspace<\/code> holds name of keyspace (database) from which data will be fetched for the chart.<\/li>\r\n \t<li>The <code>$session<\/code> variable is used to establish the connection with the database. In case of any connection error, the above code will throw an error message. You can also create a separate <code>.php<\/code> file for this step and include it instead of writing it every time.Note: To use Cassandra in PHP, please make sure you have enabled the necessary extensions by including <code>extension=php_cassandra.dll<\/code> in your <code>php.ini<\/code> configuration file.<\/li>\r\n<\/ul>\r\n<h2><span class=\"ez-toc-section\" id=\"Step_2_Fetching_Data_and_Forming_JSON_Array\"><\/span>Step 2: Fetching Data and Forming JSON Array<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nNow that we have successfully established connection with the database, we will write the query statement to fetch data for the chart.\r\n\r\nRefer to the code below to fetch the data:\r\n<pre class=\"lang:php decode:true \">$statement = new Cassandra\\SimpleStatement( 'SELECT id, name, entry_cost, permile_cost, finisher_count FROM topten' );\r\n\r\n\/\/ query execution - fully asynchronous\r\n$exec = $session-&gt;executeAsync($statement);\r\n\r\n\/\/ getting query result in a variable\r\n$result = $exec-&gt;get();\r\n<\/pre>\r\nHere, <code>$result<\/code> variable holds the data, once the above code is executed.\r\n\r\nFusionCharts understands both XML and JSON data formats. Since we will be using JSON, we will now append the data (located in <code>$result<\/code> variable) along with FusionCharts chart configurations and parse the end result as an associative JSON array.\r\n\r\nRefer to the code below to append data:\r\n<pre class=\"lang:php decode:true \">if($result) {\r\n\t\t\t\t\r\n\t\/\/ creating an associative array to store the chart attributes    \t\r\n\t$arrData = array(\r\n\"chart\" =&gt; array(\r\n\t\t\t\"caption\"=&gt; \"World's Top Marathons\",\r\n\t\t\t\"captionFontBold\"=&gt; \"1\",\r\n\t\t\t\"captionFontSize\"=&gt; \"24\",\r\n\t\t\t\"captionFont\"=&gt; \"Assistant\",\r\n\t\t\t\"subcaption\"=&gt; \"By Entry Cost (In Pounds)\",\r\n\t\t\t\"subCaptionFontBold\"=&gt; \"0\",\r\n\t\t\t\"subCaptionFontSize\"=&gt; \"19\",\r\n\t\t\t\"subCaptionFont\"=&gt; \"Assistant\",\r\n\t\t\t\"captionPadding\"=&gt; \"20\",\r\n\t\t\t\"numberPrefix\"=&gt; \"\u00a3\",\r\n\t\t\t\"canvasBgColor\"=&gt; \"#729BDF\",\r\n\t\t\t\"bgColor\"=&gt; \"#729BDF\",\r\n\t\t\t\"canvasBgAlpha\"=&gt; \"0\",\r\n\t\t\t\"bgAlpha\"=&gt; \"100\",\r\n\t\t\t\"showBorder\"=&gt; \"0\",\r\n\t\t\t\"showCanvasBorder\"=&gt; \"0\",\r\n\t\t\t\"showPlotBorder\"=&gt; \"0\",\r\n\t\t\t\"paletteColors\"=&gt; \"#FED34B\",\r\n\t\t\t\"showValues\"=&gt; \"0\",\r\n\t\t\t\"decimals\"=&gt; \"2\",\r\n\t\t\t\"usePlotGradientColor\"=&gt; \"0\",\r\n\t\t\t\"baseFontColor\"=&gt; \"#FFFFFF\",\r\n\t\t\t\"baseFont\"=&gt; \"Assistant\",\r\n\t\t\t\"baseFontSize\"=&gt; \"16\",\r\n\t\t\t\"showAlternateVGridColor\"=&gt; \"0\",\r\n\t\t\t\"divLineColor\"=&gt; \"#DBEAF8\",\r\n\t\t\t\"divLineThickness\"=&gt; \"0.9\",\r\n\t\t\t\"divLineAlpha\"=&gt; \"60\",\r\n\t\t\t\"toolTipPadding\"=&gt; \"7\",\r\n\t\t\t\"toolTipBgColor\"=&gt; \"#000000\",\r\n\t\t\t\"toolTipBorderAlpha\"=&gt; \"0\",\r\n\t\t\t\"toolTipBorderRadius\"=&gt; \"3\"\r\n));\r\n\t\r\n\t$arrData[\"data\"] = array();\r\n\t\t\/\/ iterating over each data and pushing it into $arrData array\r\n\t\tforeach ($result as $row) {\r\n\t\t\tarray_push($arrData[\"data\"], array(\r\n\t\t\t\t\"label\" =&gt; $row[\"name\"],\r\n\t\t\t\t\"value\" =&gt; $row[\"entry_cost\"]-&gt;value(),\r\n\t\t\t\t\"toolText\" =&gt; \"&lt;b&gt;\" . $row[\"name\"] . \"&lt;\/b&gt;&lt;hr&gt;Entry Cost: \u00a3\" . number_format((float)$row[\"entry_cost\"]-&gt;value(), 2, '.', '') . \"&lt;br&gt; Per-mile Cost: \u00a3\" .number_format((float)$row[\"permile_cost\"]-&gt;value(), 2, '.', '') . \"&lt;br&gt;Finishers: \" . $row[\"finisher_count\"]-&gt;value()\r\n\t\t\t));\r\n\t\t}\r\n  \t\t\t\t\r\n$jsonEncodedData = json_encode($arrData);\r\n<\/pre>\r\nIn above code, an if statement is used to check whether the value of <code>$result<\/code> variable is valid or not which creates an associative JSON array to form data for the chart.\r\n\r\nThe chart object under <code>$arrData<\/code> variable contains chart configuration options for caption, sub-caption, div lines, values, tooltips, color, etc.\r\n\r\nTo know more about customizing the chart cosmetics, you can refer to this <a href=\"https:\/\/www.fusioncharts.com\/dev\/chart-attributes?chart=bar2d\">developer documentation page<\/a>.\r\n<h2><span class=\"ez-toc-section\" id=\"Step_3_Creating_the_Chart_Container\"><\/span>Step 3: Creating the Chart Container<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTo create HTML container for the chart, use &lt;div&gt; element. Refer to the code below:\r\n<pre class=\"lang:markup decode:true \">&lt;body&gt;\r\n  &lt;div id=\"chart-container\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\r\n<h2><span class=\"ez-toc-section\" id=\"Step_4_Creating_a_Chart_Instance_and_Rendering_the_Chart\"><\/span>Step 4: Creating a Chart Instance and Rendering the Chart<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<ul>\r\n \t<li>Now, that we have the chart data and container in place, let\u2019s initiate FusionCharts PHP wrapper class instance to specify the details like chart type, chart ID, chart dimensions, chart container ID, etc to render the chart. Refer to the code below:\r\n<pre class=\"lang:php decode:true \">\/\/ creating FusionCharts instance\r\n$toptenChart = new FusionCharts(\"bar2d\", \"topChart\" , '600', '450', \"chart-container\", \"json\", $jsonEncodedData);\r\n<\/pre>\r\n<\/li>\r\n \t<li>Once done call the render() method to render the chart. render() is a PHP Class function that invokes the JS render() method, which in turn is used to render the chart. Refer to the code shown below:\r\n<pre class=\"lang:php decode:true \">\/\/ FusionCharts render method\r\n$toptenChart-&gt;render();\r\n<\/pre>\r\n<\/li>\r\n<\/ul>\r\nWe are done with all the steps to render an interactive chart using FusionCharts. The output looks like as shown in the image below:\r\n<a href=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/11\/php-cassandra-fusioncharts-output.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16475\" src=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/11\/php-cassandra-fusioncharts-output.jpeg\" alt=\"\" width=\"949\" height=\"566\" srcset=\"\/blog\/wp-content\/uploads\/2017\/11\/php-cassandra-fusioncharts-output.jpeg 949w, \/blog\/wp-content\/uploads\/2017\/11\/php-cassandra-fusioncharts-output-150x89.jpeg 150w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/a>\r\n\r\nIf you are having trouble rendering the chart, you can refer to source code from the <a href=\"https:\/\/github.com\/sikrigagan\/PHP-Cassandra-Charts\">GitHub repository<\/a>.\r\n\r\n<a href=\"https:\/\/www.pluralsight.com\/guides\/php\/creating-interactive-charts-with-php-and-cassandra\" target=\"_blank\" rel=\"noopener noreferrer\"><em>The blog first appeared here.<\/em><\/a>","protected":false},"excerpt":{"rendered":"<p>Apache Cassandra is a distributed database with unique benefits which should ideally be present in the developer&#8217;s toolkit. Cassandra is free and open-source distributed database management system which is designed to manage very large amount of structured data. In this article, we\u2019ll discuss the step-by-step process of creating charts by fetching chart data from a [&hellip;]<\/p>\n","protected":false},"author":39,"featured_media":16486,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"coauthors":[675,688],"class_list":["post-16474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating Interactive Charts With PHP And Cassandra<\/title>\n<meta name=\"description\" content=\"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.\" \/>\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\/create-charts-php-cassandra\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Interactive Charts With PHP And Cassandra\" \/>\n<meta property=\"og:description\" content=\"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/\" \/>\n<meta property=\"og:site_name\" content=\"FusionBrew - The FusionCharts Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-09T07:01:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-22T18:56:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2016\" \/>\n\t<meta property=\"og:image:height\" content=\"750\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jonathan, Gagan Sikri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan, Gagan Sikri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 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\/create-charts-php-cassandra\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Jonathan\",\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/14fbfb07e81bfbcd524a4202f34bdcbb\"\n\t            },\n\t            \"headline\": \"Creating Interactive Charts With PHP And Cassandra\",\n\t            \"datePublished\": \"2017-11-09T07:01:30+00:00\",\n\t            \"dateModified\": \"2019-07-22T18:56:21+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/\"\n\t            },\n\t            \"wordCount\": 640,\n\t            \"commentCount\": 0,\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\/create-charts-php-cassandra\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg\",\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\/create-charts-php-cassandra\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/\",\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/\",\n\t            \"name\": \"Creating Interactive Charts With PHP And Cassandra\",\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\/create-charts-php-cassandra\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg\",\n\t            \"datePublished\": \"2017-11-09T07:01:30+00:00\",\n\t            \"dateModified\": \"2019-07-22T18:56:21+00:00\",\n\t            \"description\": \"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.\",\n\t            \"breadcrumb\": {\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#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\/create-charts-php-cassandra\/\"\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\/create-charts-php-cassandra\/#primaryimage\",\n\t            \"url\": \"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg\",\n\t            \"contentUrl\": \"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg\",\n\t            \"width\": 2016,\n\t            \"height\": 750,\n\t            \"caption\": \"Creating Interactive charts with PHP and Cassandra\"\n\t        },\n\t        {\n\t            \"@type\": \"BreadcrumbList\",\n\t            \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#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 Interactive Charts With PHP And Cassandra\"\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\/14fbfb07e81bfbcd524a4202f34bdcbb\",\n\t            \"name\": \"Jonathan\",\n\t            \"image\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/image\/0b58dff9af412d6ac90a1569df4d596c\",\n\t                \"url\": \"\/blog\/wp-content\/wphb-cache\/gravatar\/15c\/15cb55f5147ef4d792cabb9144f8160bx96.jpg\",\n\t                \"contentUrl\": \"\/blog\/wp-content\/wphb-cache\/gravatar\/15c\/15cb55f5147ef4d792cabb9144f8160bx96.jpg\",\n\t                \"caption\": \"Jonathan\"\n\t            },\n\t            \"url\": \"https:\/\/www.fusioncharts.com\/blog\/author\/jonathan\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating Interactive Charts With PHP And Cassandra","description":"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.","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\/create-charts-php-cassandra\/","og_locale":"en_US","og_type":"article","og_title":"Creating Interactive Charts With PHP And Cassandra","og_description":"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.","og_url":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/","og_site_name":"FusionBrew - The FusionCharts Blog","article_published_time":"2017-11-09T07:01:30+00:00","article_modified_time":"2019-07-22T18:56:21+00:00","og_image":[{"width":2016,"height":750,"url":"https:\/\/www.fusioncharts.com\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg","type":"image\/jpeg"}],"author":"Jonathan, Gagan Sikri","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan, Gagan Sikri","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#article","isPartOf":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/"},"author":{"name":"Jonathan","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/14fbfb07e81bfbcd524a4202f34bdcbb"},"headline":"Creating Interactive Charts With PHP And Cassandra","datePublished":"2017-11-09T07:01:30+00:00","dateModified":"2019-07-22T18:56:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/"},"wordCount":640,"commentCount":0,"publisher":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#primaryimage"},"thumbnailUrl":"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/","url":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/","name":"Creating Interactive Charts With PHP And Cassandra","isPartOf":{"@id":"https:\/\/www.fusioncharts.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#primaryimage"},"image":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#primaryimage"},"thumbnailUrl":"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg","datePublished":"2017-11-09T07:01:30+00:00","dateModified":"2019-07-22T18:56:21+00:00","description":"The post covers step by step process of creating interactive charts in PHP by fetching data from a distributed database - Apache Cassandra.","breadcrumb":{"@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#primaryimage","url":"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg","contentUrl":"\/blog\/wp-content\/uploads\/2017\/11\/Creating-Interactive-charts-with-PHP-and-Cassandra1.jpg","width":2016,"height":750,"caption":"Creating Interactive charts with PHP and Cassandra"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fusioncharts.com\/blog\/create-charts-php-cassandra\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fusioncharts.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating Interactive Charts With PHP And Cassandra"}]},{"@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\/14fbfb07e81bfbcd524a4202f34bdcbb","name":"Jonathan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fusioncharts.com\/blog\/#\/schema\/person\/image\/0b58dff9af412d6ac90a1569df4d596c","url":"\/blog\/wp-content\/wphb-cache\/gravatar\/15c\/15cb55f5147ef4d792cabb9144f8160bx96.jpg","contentUrl":"\/blog\/wp-content\/wphb-cache\/gravatar\/15c\/15cb55f5147ef4d792cabb9144f8160bx96.jpg","caption":"Jonathan"},"url":"https:\/\/www.fusioncharts.com\/blog\/author\/jonathan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/posts\/16474","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\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/comments?post=16474"}],"version-history":[{"count":0,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/posts\/16474\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/media\/16486"}],"wp:attachment":[{"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/media?parent=16474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/categories?post=16474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/tags?post=16474"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.fusioncharts.com\/blog\/wp-json\/wp\/v2\/coauthors?post=16474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}