This topic is locked

Creating a Pie Chart

5/6/2008 8:23:54 AM
PHPRunner General questions
S
SumiBomb author

I use the following code to count the number of times a text entry appears in a database:
SELECT

Carrier,

Count(case when Carrier='verizon' then 1 else 0 end) AS verizon,

Count(case when Carrier='t-mobile' then 1 else 0 end) AS tmobile,

Count(case when Carrier='sprint' then 1 else 0 end) AS sprint,

Count(case when Carrier='cingular' then 1 else 0 end) AS cingular

FROM `_Incoming_SMS`

GROUP BY Carrier
When I create the Pie Chart the numbers appear correctly, but the Carriers (which is stored in Carrier on the table) only appear as the first color

S
SumiBomb author 5/6/2008

I get the same problem when I use this code:

SELECT

Carrier,

count(Carrier)

FROM `_Incoming_SMS`

GROUP BY Carrier
I select the count as the data set and carrier as the label field. In the chart the label appears as Carrier count(carrier)

J
Jane 5/6/2008

Hi,
to change labels in the chart add alias to your SQL query:

SELECT

Carrier,

count(Carrier) as sCarrier

FROM `_Incoming_SMS`

GROUP BY Carrier


Regarding the second problem.

Please send a couple of screenshots and detailed description of what you're doing to support@xlinesoft.com.