Membuat dynamic database chart dengan PHPRUNNER



Building dynamic database charts with PHPRunner

Charts provide quick and easy way to visualize even the most complex data. PHPRunner allows you to build database-based charts (Line, pie, doughnut, horizontal/vertical bars, 3D and others).
With PHPRunner you can create, customize, preview and deploy any chart with just a few mouse clicks. Right in the PHPRunner's Visual Editor environment you can copy and paste any chart to any other page (i.e. report/list/view/another chart) which will allow you to quickly build powerful dashboards with multiple graphs on the same page.
Charts require the data fields that store numeric values. However, you can build a chart based on any data if you are using aggregate functions.
Consider the following Orders table:
CustomerCountryTotal
Andrew PetersUSA$250
Katie BradshowAustralia$85
Jeff SimpsonUSA$150
Arnold MatteusGermany$120
Arnold MatteusGermany$160
Jeff MontgomeryGB$150
Andrew PetersUSA$65
Jeff SimpsonUSA$95
Luke SohuFrance$40
Jeff MontgomeryGB$120
Example 1: Total Sales per country
?
1
2
3
4
select Country, sum(total) as STotal
from Orders
group by country
order by 2 desc

This query produces the following results:
CountryStotal
USA$560
Germany$280
GB$270
Australia$85
France$40
Example 2: Number of orders per country
?
1
2
3
4
select Country, count(total) as CTotal
from Orders
group by country
order by 2 desc

This query produces the following results:
CountryCtotal
USA4
Germany2
GB2
Australia1
France1