whbuescher
Members-
Content count
6 -
Joined
-
Last visited
Everything posted by whbuescher
-
PHP API + MySQL Multi-series chart
whbuescher replied to Rahul Kumar's topic in FusionCharts and PHP
Any ideas anyone? -
Currently I am able to use single series charts without a problem: $FC = new FusionCharts("Column2D","250","250"); $FC2->setSWFPath("../charts/fusioncharts/"); $strParam="caption=Type;bgColor=FFFFFF;borderColor=FFFFFF;xAxisName=Type;yAxisName=Quantity;decimalPrecision=0;labelDisplay=ROTATE;slantLabels=1"; # Set chart attributes $FC->setChartParams($strParam); $result = $r->query("SELECT iType, COUNT(iType) as total FROM i GROUP BY iType"); if ($result) { $FC->addDataFromDatabase($result, "total", "iType"); } I am trying to create a multi series chart from the following table. User Type Type Code Type1 A1 Type1 A2 Type1 A2 Type2 A1 Type2 A1 Type2 A1 Type3 A1 Type3 A2 Type3 A3 Type3 A3 Type4 A3 Type5 A1 The user type is meant to be the categories and the Each code should be a series for each user type. I want to end up with a graph which shows how many of each Code is for each type of user. Any help in setting up a multi-series chart from a database would be great.
-
PHP API + MySQL Multi-series chart
whbuescher replied to Rahul Kumar's topic in FusionCharts and PHP
Hi, thankyou for the reply. It appears that it almost worked. The categories display correctly as the different results of TYPE along the bottom of the chart. However, the results of the CODE are being totaled and displayed for the first category. It is definitely feeling closer the results just need to be grouped by the TYPE It looks something like the attached file. -
PHP API + MySQL Multi-series chart
whbuescher replied to Rahul Kumar's topic in FusionCharts and PHP
No I still haven't found a solution to this issue. I would really love an example which uses an sql query to count data for a multi-series chart and then display it with the PHP CLASS For my specific example I am trying to get the code to display the categories as the x axis for the table. For this I was using the DISTINCT function so that it pulls all of the different types. Then I am trying group and count the results from another field in the table, so that each different type of result is counted and then displayed as a different series. This example I feel is getting close. I just need to get it to identify each different type of result as a seperate dataset and then count them for each category. http://www.fusioncharts.com/docs/?/PHPClassAPI/MultiSeriesChart.html -
PHP API + MySQL Multi-series chart
whbuescher replied to Rahul Kumar's topic in FusionCharts and PHP
So my first category "Manager" Would appear like this in the database table Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 1 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 2 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 Manager Code 3 I would need the query to count the number of each code for each category -
PHP API + MySQL Multi-series chart
whbuescher replied to Rahul Kumar's topic in FusionCharts and PHP
So you dont think its possible to use the PHP Class for a multi-series chart? If you see the attached file this is basically what I want to do. # Create Column3D chart Object $FC = new FusionCharts("MSColumn3D","250","250"); # set the relative path of the swf file $FC->setSWFPath("../seracharts/fusioncharts/"); # Store chart attributes in a variable $strParam="caption=Weeks;bgColor=FFFFFF;borderColor=FFFFFF;decimalPrecision=0;paletteColors=FF5904,0372AB,FF0000;baseFontSize=8"; $FC->addCategory("Manager"); $FC->addCategory("Engineer"); $FC->addCategory("Teacher"); $FC->addCategory("Driver"); # Create a new dataset $FC->addDataset("Code 1"); # Add chart values for the above dataset $FC->addChartData("10"); $FC->addChartData("9"); $FC->addChartData("16"); $FC->addChartData("11"); # Create second dataset $FC->addDataset("Code 2"); # Add chart values for the second dataset $FC->addChartData("10"); $FC->addChartData("8"); $FC->addChartData("6"); $FC->addChartData("4"); # Create third dataset $FC->addDataset("Code 3"); # Add chart values for the third dataset $FC->addChartData("12"); $FC->addChartData("14"); $FC->addChartData("6"); $FC->addChartData("7");