Search the Community

Showing results for tags 'SQL'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Company Forums
    • Company News
  • Product Forums
    • FusionCharts XT
    • FusionWidgets XT
    • PowerCharts XT
    • FusionMaps XT
    • Collabion Charts for SharePoint
    • jQuery Plugin for FusionCharts
    • AngularJS plugin
    • ReactJS plugin
  • General Forums
    • FusionCharts Jobs and Consultation
    • FusionLounge

Found 5 results

  1. Hi I’m relatively new to Fusion Charts but have been enjoying trying things out with the PHP wrapper. I want to pull data from a local MySQL database using a suitable query and display it in a line plot. As a first attempt I followed the first example on this Fusion Charts page, changed the variables to those in my database, updated the sql query, swapped the bar chart to a line plot and hey presto, everything works! The trouble is, the sql query is hard coded in the PHP. I’m ideally looking to have a web page which has options (drop down menus etc) for the user to select what is plotted based on fields within the MySQL database. The example given showed populations in various countries but the options would allow the user to choose either that or perhaps average number of days people are at work in each country. The other fields would be present in the MySQL database and the user selectable fields would be used to update the query before re-plotting the Fusion Chart. Essentially I just wanted to be able to generate the MySQL query based on user selections before the plot is drawn. I’m not looking for a complete solution here just some guidance on how to go about this. Any help greatly appreciated!
  2. Is it possible to run an SQL query on an Excel or a csv file (that has, say, 30 columns) and generate a chart dynamically? Basically, I am looking at one chart with a drop-down of options each running an SQL query on the csv file and generating the chart. Thank you!
  3. So, i have DB like these : +----------+------------+-------+ | Time | Date | A0 | +----------+------------+-------+ | 17:00:00 | 2015-06-23 | 100 | | 17:05:00 | 2015-06-23 | 120 | | 17:10:00 | 2015-06-23 | 200 | | 17:00:00 | 2015-06-24 | 200 | | 17:05:00 | 2015-06-24 | 190 | | 17:10:00 | 2015-06-24 | 200 | | 08:00:00 | 2015-06-25 | 90 | +----------+------------+-------+ and I use these code : <?php //We have included ../Includes/FusionCharts.php, which contains functions //to help us easily embed the charts. include("class/Includes/FusionCharts.php"); include("class/Includes/DBConn.php"); ?> <HTML> <HEAD> <TITLE> FusionCharts XT - </TITLE> <SCRIPT LANGUAGE="Javascript" SRC="fusioncharts/fusioncharts.js"></SCRIPT> <SCRIPT LANGUAGE="Javascript" SRC="fusioncharts/themes/fusioncharts.theme.fint.js"></SCRIPT> </HEAD> <BODY> <?php $link = connectToDB(); $strQueryCategories = "select distinct Time from input where Date between '2015-06-23' and '2015-06-27' order by Time"; $resultCategories = mysql_query($strQueryCategories) or die(mysql_error()); $strQueryData = "select * from input where Date between '2015-06-23' and '2015-06-27' "; $resultData = mysql_query($strQueryData) or die(mysql_error()); $strXML = "<chart legendPostion='' caption='Konsentrasi CO2' subCaption='By Quantity' xAxisName='Time' yAxisName='Concentration (ppm)' showValues='0' formatNumberScale='0' rotateValues='1' theme='fint'>"; $strXML .= buildCategories ($resultCategories, "Time"); $strXML .= buildDatasets ( $resultData, "A0", "Date"); $strXML .= "</chart>"; echo renderChart("MSLine", "", $strXML, "FactorySum", 600, 300, false, true); mysql_free_result($resultCategories); mysql_free_result($resultData); mysql_close($link); function buildCategories ( $result, $labelField ) { $strXML = ""; if ($result) { $strXML = "<categories>"; while($ors = mysql_fetch_array($result)) { $strXML .= "<category label='" . $ors[$labelField]. "'/>"; } $strXML .= "</categories>"; } return $strXML; } function buildDatasets ($result, $valueField, $controlBreak ) { $strXML = ""; if ($result) { $controlBreakValue =""; while( $ors = mysql_fetch_array($result) ) { echo" "; if( $controlBreakValue != $ors[$controlBreak] ) { $controlBreakValue = $ors[$controlBreak]; $strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue . "'>" ) ; } $strXML .= "<set value='" . $ors[$valueField] . "'/>"; } $strXML .= "</dataset>"; } return $strXML; } ?> </BODY> </HTML> But what I get is a chart with false value. the 1st value of A0 data at 2015-06-23 and 2015-06-24 are at 08:00:00 instead of 17:00:00, and so goes on for the other data. Please someone help me So the only data at 08:00:00 only 2015-06-25 data
  4. HomeKeeper is a Salesforce app for affordable homeownership organizations around the country to manage their programs. We seek to expand functionality by embedding a data visualization dashboard into the app, so individual organizations have a degree of self-analysis. We currently do our charts with Tableau (see below); however, because of their licensing model, we are seeking alternative solutions such as FusionCharts. Desired system functionality includes: Security of organizational data Dashboard embedded into our Salesforce app The ability to benchmark one’s organization against others, while preserving others’ privacy Our Analysts’ ability to make basic alterations to charts and layouts Basic filtering abilities (dates, categories, etc.) Variety of benchmarked data (based on region, portfolio size, etc) The ability to leave and view dashboard comments Individual scatterplot points access the specific data they refer to Popup text and tooltips to provide additional data or context We seek a chart developer with the ability to write the proper queries and implement the dashboard into our Salesforce app for a contract job. A more thorough description with examples is included in the attached document. Please direct all inquiries to [email protected]. SHK2.pdf
  5. Hello to Forum, I am new one with combining Charts with FusionChart XT. I have created some normal charts with Pie,Column,Line but i have some difficulties with MultiSeries Line Chart and would be appreciate if you can help me please. In the text below i will provide you my php code: <?php //We have included ../Includes/FusionCharts.php and ../Includes/DBConn.php, which contains //functions to help us easily embed the charts and connect to a database. include("FusionCharts.php"); #include("../Includes/DBConn.php"); ?> <HTML> <HEAD> <TITLE>FusionCharts XT - Database Example</TITLE> <SCRIPT LANGUAGE="Javascript" SRC="FusionCharts.js"></SCRIPT> </HEAD> <BODY> <CENTER> <?php //In this example, we show how to connect FusionCharts to a database. //For the sake of ease, we have used an MySQL databases containing two //tables. // Connect to the DB mysql_connect('localhost','root','google'); mysql_select_db('Difference_Output'); // SQL query for category labels $strQueryCategories ="SELECT DISTINCT `CHANNEL_ID` FROM `DIFFERENTS` WHERE `SECONDS_ID2`>0 AND `SECONDS_ID1`>0 ORDER BY `CHANNEL_ID`"; // Query database $resultCategories = mysql_query($strQueryCategories) or die(mysql_error()); // SQL query for factory output data $strQueryData = "SELECT `SECONDS_ID2`, `SECONDS_ID1`, `CHANNEL_ID` FROM `DIFFERENTS` WHERE `SECONDS_ID2`>0 AND `SECONDS_ID1`>0 ORDER BY `SECONDS_ID2`,`SECONDS_ID1`"; // Query database $resultData = mysql_query($strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we have to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he shouldn't //see the animation again. //$strXML will be used to store the entire XML document generated //Generate the chart element $strXML = "<chart legendPosition='' caption='Records Output report' subCaption='By Seconds' xAxisName='Factory' yAxisName='Units' showValues='0' formatNumberScale='0' rotateValues='1' animation='1'>"; // Build category XML $strXML .= buildCategories ($resultCategories, "CHANNEL_ID"); // Build datasets XML $strXML .= buildDatasets ( $resultData, "SECONDS_ID2", "SECONDS_ID1"); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML echo renderChart("MSLine.swf", "", $strXML, "FactorySum", 1000, 700, false, true); // Free database resource # mysql_free_result($resultCategories); # mysql_free_result($resultData); # mysql_close($link); /*********************************************************************************************** * Function to build XML for categories * @param $result Database resource * @param $labelField Field name as String that contains value for chart category labels * * @return categories XML node */ function buildCategories ( $result, $labelField ) { $strXML = ""; if ($result) { $strXML = "<categories>"; while($ors = mysql_fetch_array($result)) { $strXML .= "<category label='" . $ors[$labelField]. "'/>"; } $strXML .= "</categories>"; } return $strXML; } /*********************************************************************************************** * Function to build XML for datasets that will contain chart data * @param $result Database resource. The data should come ordered by a control break field which will require to identify datasets and set its value to dataset's series name * @param $valueField Field name as String that contains value for chart dataplots * @param $controlBreak Field name as String that contains value for chart dataplots * * @return Dataset XML node */ function buildDatasets ($result, $valueField, $controlBreak ) { $strXML = ""; if ($result) { $controlBreakValue =""; while( $ors = mysql_fetch_array($result) ) { if( $controlBreakValue != $ors[$controlBreak] ) { $controlBreakValue = $ors[$controlBreak]; $strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue . "'>" ) ; } $strXML .= "<set value='" . $ors[$valueField] . "'/>"; } $strXML .= "</dataset>"; } return $strXML; } ?> </BODY> </HTML> The cart is running fine but is giving me all of the values, the thing that i need is 2 lines with dots.The CHANNEL_ID i want to be in X axis value and SECONDS1 and SECONDS2 IN Y values. For every other Details i can provide you my help. Thanks