From 71f6398a3296e28fd33c799556d4f19d2364dd30 Mon Sep 17 00:00:00 2001 From: PullMonkey Date: Thu, 31 Jul 2008 15:50:43 +0000 Subject: [PATCH] Labels do not need to be in the form "labels" : {"labels" : ....} for anything other than XAxis .. that I can tell --- lib/open_flash_chart.rb | 11 ----------- lib/x_axis.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/open_flash_chart.rb b/lib/open_flash_chart.rb index 47c9858..3a863ca 100644 --- a/lib/open_flash_chart.rb +++ b/lib/open_flash_chart.rb @@ -58,17 +58,6 @@ def set_colours(colour, grid_colour) @grid_colour = grid_colour end - # for some reason the json that needs to be produced is like this: - # "x_axis": { "offset": false, "labels": { "labels": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] } } - # note the "labels":{"labels": ....} - def set_labels(labels) - @labels = {:labels => labels} - end - - def labels=(labels) - @labels = {:labels => labels} - end - def set_tooltip(tip) if tip.is_a?(Tooltip) #we have a style for our chart's tooltips diff --git a/lib/x_axis.rb b/lib/x_axis.rb index 3b72bc4..fca8220 100644 --- a/lib/x_axis.rb +++ b/lib/x_axis.rb @@ -2,4 +2,14 @@ class XAxis < OpenFlashChart def set_3d(v) @threed = v end + + # for some reason the json that needs to be produced is like this: + # "x_axis": { "offset": false, "labels": { "labels": [ "Jan", "Feb", "Mar", "- # note the "labels":{"labels": ....} + def set_labels(labels) + @labels = {:labels => labels} + end + + def labels=(labels) + @labels = {:labels => labels} + end end