siric Report post Posted June 16, 2017 Hi, I am trying to create a piechart under the following circumstances: My each row in my table contains a gender. I want to be able to sum up the number of males and females and then plot that in a pie chart. The query that I am using SELECT SUM(gender = 'male') AS male, SUM(gender = 'female') AS female FROM markers; presents 2 columns (male and female) with a count below. How is it possible to get this into the array for the chart seeing that the data required should be by row rather than column? Query Results: | male | female | | 23 | 43 | Should be | male | 23 | | female | 43 | Thanks Steve Share this post Link to post Share on other sites
siric Report post Posted June 16, 2017 SELECT gender, COUNT(*) AS COUNT FROM markers GROUP BY gender; Share this post Link to post Share on other sites
Ayan Bhadury Report post Posted June 23, 2017 FusionCharts can be rendered using many server side language like Asp.net, PHP, Java and Python, and the data can be fetched from the database as well. For fetching data from the database and rendering pie chart based , try to fetch the data from the data base using sql query and then structure the data in FusionCharts format using the data structure of the server side language. Then finally apply this datasource in the FusionCharts constructor object. If you are still facing any problem, please let us know which server side language you are using also the sql file so that we can assist you further. Share this post Link to post Share on other sites