Trouble displaying a polar chart

0 views
Skip to first unread message

Dav Yaginuma

unread,
Feb 1, 2008, 7:44:56 PM2/1/08
to ZiYa Plugin
First, thanks for this nice interface to a great tool, and thanks for
restarting your web server just now.

I've looked at the example page for Polar charts at http://ziya.liquidrail.com/tutor
now but I'm still having problems displaying a polar chart. The top of
the chart is being cut off and although the associated yml file for
this chart is being loaded, the chart_rect x and y values seem to have
no effect.

I have pasted the relevant code in here http://pastie.caboo.se/146454
just in case it gets formatted weird below.

Also here is an screenshot of the generated web page. No matter what I
change the x and y to in the yml, the chart never moves (However the x
and y values do affect the legend_rect placement, and width/height
work for chart_rect): http://akuaku.org/~dav/images/misc/polar_chart.png

In controller:

def show_bpi_chart
graph = Ziya::Charts::Polar.new( nil, "BPI Overview",
"bpi_overview_chart")
graph.add( :axis_category_text, poles.keys.map {|game_category|
game_category.name} )
graph.add( :series, "BPI Across All Cognitive Training Areas",
poles.values )
render :xml => graph.to_xml
end


In bpi_overview_chart.yml:

<%=chart :polar%>
# Change chart rectangle
<%=component :chart_rect%>
negative_color: c0b15c
positive_color: f0811c
negative_alpha: 30
X: 0
Y: 0
height: 200
width: 600
<%=component :legend_rect %>
x: 0
y: 280
width: 600
<%=component :chart_border %>
bottom_thickness: 0
left_thickness: 0


In rhtml:

<%= ziya_chart( url_for(:action => 'show_bpi_chart'), :align =>
'center', :height => 300, :width => 600 ) %>


In the rails log:
ZiYa [loading] -- public/charts/themes/default/base_chart.yml
ZiYa [loading] -- public/charts/themes/default/polar_chart.yml
ZiYa [loading] -- public/charts/themes/default/bpi_overview_chart.yml

Fernand Galiana

unread,
Feb 1, 2008, 10:22:31 PM2/1/08
to ziya-...@googlegroups.com
Hi Dav,

    Thanks for the kind words !

    Hum... your setup looks correct. The thing I've found is that in your chart yml file
    you have the x and y for the chart_rect specified as upper case X and Y which will
    cause the centering of the chart to not being affected.
  
-Fernand

Dav Yaginuma

unread,
Feb 4, 2008, 1:19:16 PM2/4/08
to ZiYa Plugin

Ha!

That was it. This is one of the reasons I like pair programming.
Unfortunately was running solo on Friday :)

Thanks!

On Feb 1, 7:22 pm, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Hi Dav,
>
> Thanks for the kind words !
>
> Hum... your setup looks correct. The thing I've found is that in your
> chart yml file
> you have the x and y for the chart_rect specified as upper case X and Y
> which will
> cause the centering of the chart to not being affected.
>
> -Fernand
>
> On Feb 1, 2008 5:44 PM, Dav Yaginuma <dav.yagin...@gmail.com> wrote:
>
>
>
> > First, thanks for this nice interface to a great tool, and thanks for
> > restarting your web server just now.
>
> > I've looked at the example page for Polar charts at
> >http://ziya.liquidrail.com/tutor
> > now but I'm still having problems displaying a polar chart. The top of
> > the chart is being cut off and although the associated yml file for
> > this chart is being loaded, the chart_rect x and y values seem to have
> > no effect.
>
> > I have pasted the relevant code in herehttp://pastie.caboo.se/146454
> > just in case it gets formatted weird below.
>
> > Also here is an screenshot of the generated web page. No matter what I
> > change the x and y to in the yml, the chart never moves (However the x
> > and y values do affect the legend_rect placement, and width/height
> > work for chart_rect):http://akuaku.org/~dav/images/misc/polar_chart.png<http://akuaku.org/%7Edav/images/misc/polar_chart.png>

Edward Sutterfield

unread,
Mar 28, 2008, 8:50:40 AM3/28/08
to ZiYa Plugin
http://wikipedlla.com/trouble_displaying_a_polar_chart
> First, thanks for this nice interface to a great tool, and thanks for
> restarting your web server just now.
> I've looked at the example page for Polar charts at http://ziya.liquidrail.com/tutor
> now but I'm still having problems displaying a polar chart. The top of
> the chart is being cut off and although the associated yml file for
> this chart is being loaded, the chart_rect x and y values seem to have
> no effect.
> I have pasted the relevant code in here http://pastie.caboo.se/146454
> just in case it gets formatted weird below.
> Also here is an screenshot of the generated web page. No matter what I
> change the x and y to in the yml, the chart never moves (However the x
> and y values do affect the legend_rect placement, and width/height
> work for chart_rect): http://akuaku.org/~dav/images/misc/polar_chart.png
> In controller:
> def show_bpi_chart
> &nbsp; &nbsp; graph &nbsp;= Ziya::Charts::Polar.new( nil, &quot;BPI Overview&quot;,
> &quot;bpi_overview_chart&quot;)
> &nbsp; &nbsp; graph.add( :axis_category_text, poles.keys.map {|game_category|
> game_category.name} )
> &nbsp; &nbsp; graph.add( :series, &quot;BPI Across All Cognitive Training Areas&quot;,
> poles.values )
> &nbsp; &nbsp; render :xml =&gt; graph.to_xml
> end
> In bpi_overview_chart.yml:
> &lt;%=chart :polar%&gt;
> &nbsp; # Change chart rectangle
> &nbsp; &lt;%=component :chart_rect%&gt;
> &nbsp; &nbsp; negative_color: c0b15c
> &nbsp; &nbsp; positive_color: f0811c
> &nbsp; &nbsp; negative_alpha: 30
> &nbsp; &nbsp; X: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
> &nbsp; &nbsp; Y: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
> &nbsp; &nbsp; height: &nbsp; &nbsp; &nbsp; &nbsp; 200
> &nbsp; &nbsp; width: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;600
> &nbsp; &lt;%=component :legend_rect %&gt;
> &nbsp; &nbsp; x: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
> &nbsp; &nbsp; y: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;280
> &nbsp; &nbsp; width: &nbsp; &nbsp; &nbsp;600
> &nbsp; &lt;%=component :chart_border %&gt;
> &nbsp; &nbsp; bottom_thickness: &nbsp; 0
> &nbsp; &nbsp; left_thickness: &nbsp; &nbsp; 0
> In rhtml:
> &lt;%= ziya_chart( url_for(:action =&gt; 'show_bpi_chart'), :align =&gt;
> 'center', :height =&gt; 300, :width =&gt; 600 ) %&gt;
Reply all
Reply to author
Forward
0 new messages