bar chart: dynamic height?

1 view
Skip to first unread message

sant0sk1

unread,
May 3, 2008, 10:49:30 PM5/3/08
to ZiYa Plugin
I am generating a bar chart that has a dynamic amount of entries in
its data series. I have no problem setting a fixed width for this
chart but would like the height to change depending on number of data
entries.

Right now it appears that ziya_chart only takes a single value for the
height option, and defaults to 300 if left blank. Is there a way to
set the height as a multiple of bar height? For instance, instead
of :height => 300 we could set something like :barHeight => 15.

That way the total height is simply :barHeight * number of data
entries in :series array.

Does anybody know how to obtain this functionality?

sant0sk1

unread,
May 4, 2008, 10:55:14 PM5/4/08
to ZiYa Plugin
nevermind, all I had to do was create an instance variable in the
controller like this:

@chartHeight = x + (series_array.length * y)

and pass that into ziya_chart as :height => @chartHeight

Please disregard this thread, unless you know of a more elegant
solution...
Reply all
Reply to author
Forward
0 new messages