noosfero | Use chartkick gem to improve the visualization of custom_form submissions. (!1316)
David Carlos
gitlab at mg.gitlab.com
Thu Sep 28 20:10:37 BRT 2017
David Carlos commented on a discussion on plugins/custom_forms/lib/custom_forms_plugin/graph.rb:
> + # "percents" => {"foo" => 40, "bla" => 60}
> + # },
> + # {"data" => { "foo"=> 5, "test" => 7, "show_as" => "check_box"}}
> + # ]
> + # Each 'data' key on @query_results represents the data that will be used by
> + # chartkick lib, to render a graph based on the show_as value. The 'percents'
> + # key will be used to show the percentage by answer when render a pizza
> + # chart.
> + #
> + # @answers_with_alternative_label have the format
> + # [
> + # { "1" => {"foo" : 5}, "2" => {"bla": 7},
> + # "show_as" => {"show_as" => "radio"}
> + # },
> + # { "21" => {"foo" : 2}, "2" => {"test": 15},
> + # "show_as" => {"show_as" => "check_box"}
`"show_as" => {"show_ads" => "check_box}` makes easier to generate the data that chartkick expects, but I think that makes difficult the code understanding . I will fix this.
---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1316#note_41838897
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170928/a1c4b58e/attachment.html>
More information about the Noosfero-dev
mailing list