|
|
|
Forum 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?
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 6:58:37 AM
Posts: 632,
Visits: 1,928
|
|
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
|
|
|
|
|
Forum 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
|
|
|
|