![]() ![]() 'Fonts' //5 // Dataset definition $DataSet = new pData $DataSet -> AddPoint ( array ( 1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7 )) $DataSet -> AddSerie () $DataSet -> SetSerieName ( "Sample data", "Serie1" ) // Initialise the graph $Test = new pChart ( 700, 230 ) $Test -> setFontProperties ($fontFolder. 'pData.class' )) App :: import ( 'Vendor', 'pChart', array ( 'file' => 'pchart'. autoRender = false //3 App :: import ( 'Vendor', 'pData', array ( 'file' => 'pchart'. ![]() Create controller class at "app/controllers/pcharts_controller.php".Copy and paste pData.class from "pChart.1.27d/pChart/pData.class" in unzip folder to CakePHP's vendor folder"app/vendors/pchart/pData.class".Copy and paste pChart.class from "pChart.1.27d/pChart/pChart.class" in unzip folder to CakePHP's vendor folder"app/vendors/pchart/pChart.class".Copy and paste pCache.class from "pChart.1.27d/pChart/pCache.class" in unzip folder to CakePHP's vendor folder"app/vendors/pchart/pCache.class".Copy and paste Font folder from "pChart.1.27d/Fonts" in unzip folder to CakePHP's vendor folder "app/vendors/pchart/Fonts".Unzip downloaded pChart zip file (pChart.1.27d).Create a folder "pcharts" in CakePHP's vendor folder:.If you don't have the knowledge of setting up CakePHP, please refer to its official site at Cookbook. Setup CakePHP, make sure it can connect to your database and tmp folder writable.And in download page, select pChart.1.27d.rar. in this tutorial we are using pChart 1.27 - beta. Download pChart from it official download page.Download CakePHP, in this tutorial we are using CakePHP 1.3.2.Please note the purpose of this tutorial is not to implement complex charts using pChart, you should look into pChart official site for that. The goal of this tutorial is to show a basic chart using pChart in CakePHP environment, during this process, you should gain the idea of using pChart in CakePHP. In this tutorial, we will learn how to setup pChart in CakePHP. This project is still under development and new features or fix are made every week. As we all know most of today’s chart libraries have a cost, but pChart is intended to be free according to its official site. Var chart = Highcharts.chart( // code to create graphĭocument.getElementById('data').PChart is a PHP class oriented framework designed to create aliased charts. ![]() This is the part of the view I want to stay rendered where I have the functionality related to the hidden form Form->create('Save data', array('url'=>'/exportations/save_data/'.$id, 'enctype' => 'multipart/form-data', 'method' => 'post', 'id' => 'data'))?> ![]() In case it helps, I am adding the code I have for this action: Due to this, I'd like to know if there is another alternative for being able to call one function in my controller but staying at the page I am at (not by redirecting because of the looping aspect). Nevertheless, these lines do not seem to be working for me, as the action keeps being redirected to this function trying to render a non existing view instead of staying in the previous one. Therefore, I wanted to call this function without redirecting to the previous view but without rendering a new view either, for which I was using the following: $this->autoRender = false My problem is that I don't want to leave the current view, but I can not redirect to the view I want to stay in either because that would create a constant loop of loading the page, calling my function when loading has finished and then redirecting again. I am trying to submit a hidden form whenever a page is loaded, for which I have created a function in my controller. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |