Ziya problem

0 views
Skip to first unread message

andrea...@gmail.com

unread,
Jun 25, 2008, 6:32:30 AM6/25/08
to ZiYa Plugin
Hi to all,

i've installed yesterday the Ziya plugin but i'm having some
troubles....
The installation works fine, i've foolowed the tutorial on youtube and
i've looked to others but the view doesn't display me the graph but
only a string like this :

line666666768bb3200620072008Dogs102030Cats5-2030

here it's the code in my controller :

def line
chart = Ziya::Charts::Line.new
chart.add(:axis_category_text, %w{2006 2007 2008})
chart.add(:series, "Dogs", [10,20,30])
chart.add(:series, "Cats", [5,-20,30])
render :text => chart
end

And this is the view line.rhtml:

<%=gen_chart( "line", url_for( :controller => 'calls', :action =>
'line' ), '#ffffff', 400, 300 )%>

So no graph but only the string above!!!
I'm running on debian 4.0...

Can anybody help me???

Fernand Galiana

unread,
Jun 25, 2008, 10:14:54 AM6/25/08
to ziya-...@googlegroups.com
Hi Andrea,

   Cool !! Welcome...

   Are you using the ZiYa plugin or gem ?

   In any case the video tutorial is a bit out of date now... Sorry, working on a new one...

   I think you need to change this line in your controller

   > render :text => chart

   render :xml => chart.to_xml

-Fernand

andrea...@gmail.com

unread,
Jun 25, 2008, 1:16:14 PM6/25/08
to ZiYa Plugin
Hi Fernand,

Really thanks for the reply!!!
i'm using the plugin for my rails app....
I've made the substitution in my controller and something happends....
Now i see an xml page but still no graph :)

Any suggestion??

Andrea



On 25 Giu, 16:14, "Fernand Galiana" <fernand.gali...@gmail.com> wrote:
> Hi Andrea,
>
> Cool !! Welcome...
>
> Are you using the ZiYa plugin or gem ?
>
> In any case the video tutorial is a bit out of date now... Sorry, working
> on a new one...
>
> I think you need to change this line in your controller
>
> > render :text => chart
>
> render :xml => chart.to_xml
>
> -Fernand
>
> On Wed, Jun 25, 2008 at 4:32 AM, andreacam...@gmail.com <

Fernand Galiana

unread,
Jun 26, 2008, 1:17:26 AM6/26/08
to ziya-...@googlegroups.com
Hi Andrea,

   Hum... I am guessing you are hitting the controller action directly ??

   Remember, the line action is the actual action that the ZiYa chart will be calling think of it as a callback from
   the view and back to the controller. ie

   You will hit http://localhost:3000/fred which invokes controller Fred, action index.
   This would render the fred/index.html.erb template in which the ziya_chart helper declaration resides.
   Then the helper will make a callback to the controller says Fred for the action line which will produce the
   xml to render the chart.

   Sounds right, or did I miss your question ? If so I will need more info on your setup....

-Fernand

andrea...@gmail.com

unread,
Jun 26, 2008, 4:20:06 AM6/26/08
to ZiYa Plugin
Hi Fernand,

my "work-flow" wasn't correct, now i've followed your instruction and
everything seems good....

Really thanks for your help...

Andrea

On 26 Giu, 07:17, "Fernand Galiana" <fernand.gali...@gmail.com> wrote:
> Hi Andrea,
>
> Hum... I am guessing you are hitting the controller action directly ??
>
> Remember, the line action is the actual action that the ZiYa chart will
> be calling think of it as a callback from
> the view and back to the controller. ie
>
> You will hithttp://localhost:3000/fredwhich invokes controller Fred,
> action index.
> This would render the fred/index.html.erb template in which the
> ziya_chart helper declaration resides.
> Then the helper will make a callback to the controller says Fred for the
> action line which will produce the
> xml to render the chart.
>
> Sounds right, or did I miss your question ? If so I will need more info
> on your setup....
>
> -Fernand
>
> On Wed, Jun 25, 2008 at 11:16 AM, andreacam...@gmail.com <
Reply all
Reply to author
Forward
0 new messages