Multi Series from complex Query
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Multi Series from complex Query Expand / Collapse
Author
Message
Posted 5/5/2008 2:53:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/6/2008 1:33:11 PM
Posts: 4, Visits: 7
Hi,

I have a query that selects data from a few tables, that I'm trying to get added to a multi series chart.

Here's the query:


select qjr.qjr_response, qjq.quickjournal_question_text, qjj.quickjournal_journal_date
from quickjournal_journals as qjj
join quickjournal_questions as qjq on qjj.quickjournal_id = qjq.quickjournal_id
join quickjournal_responses as qjr on
(qjq.quickjournal_question_id = qjr.qjr_question_id and qjr.qjr_journal_id = qjj.quickjournal_journal_id)
where qjj.uid = 551
and qjj.quickjournal_journal_date >= '2005-10-08' and qjj.quickjournal_journal_date <= '2005-11-07'
and qjq.quickjournal_question_id in (1, 2, 3, 4, 5, 6, 7, 8, 11, 13, 15, 16)
order by qjq.quickjournal_question_text, qjj.quickjournal_journal_date ASC


Here's a sample of results returned:


qjr_response quickjournal_question_text quickjournal_journal_date
6 Concentration / Focus 2005-11-01
8 Concentration / Focus 2005-11-02
192 Daily Weight (lbs) 2005-11-01
191 Daily Weight (lbs) 2005-11-02
8 Hours of sleep 2005-11-01
7 Hours of sleep 2005-11-02
8 My Mood 2005-11-01
5 My Mood 2005-11-02
6 Pain and Soreness 2005-11-01
9 Pain and Soreness 2005-11-02


And here's my code from my php file to get the information added to the LineMS chart type (multi series):


# Set Chart Data
$FC->addDatasetsFromDatabase($rs, "qjq.quickjournal_question_text", "qjr.qjr_response" );

# Render Chart
$FC->renderChart();


All I'm getting is a chart with NaNM on the y-axis and nothing on the x-axis. Any thoughts on what I'm doing wrong?
Post #6099
Posted 5/6/2008 4:26:28 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 10/3/2008 11:59:51 PM
Posts: 328, Visits: 1,356
Hi Mac,
  I went through your problem. Please use only field name.
 
# Set Chart Data
$FC->addDatasetsFromDatabase($rs, "quickjournal_question_text", "qjr_response" );

# Render Chart
$FC->renderChart();

Thanks,
Arindam

FusionCharts Team
www.fusioncharts.com

Post #6103
Posted 5/6/2008 10:42:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/6/2008 1:33:11 PM
Posts: 4, Visits: 7
Hi Arindam,

Thanks for the help, I figured out what the problem was through another example I found in the forums but it was good to learn that I shouldn't be using aliases to qualify the field names. I ran into an issue where for some reason the xml data coming out on the javascript side had a number of line breaks in it, I'm not sure why as I was using data directly from the query with the addDatasetsFromDatabase function. For the time being, I've just disabled certain data that seems to be causing the line breaks.

~Mac
Post #6109
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 5:19am


Execution: 0.141.