noosfero | Use chartkick gem to improve the visualization of custom_form submissions. (!1316)

Rodrigo Souto gitlab at mg.gitlab.com
Thu Sep 28 09:43:25 BRT 2017


Rodrigo Souto started a new 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"}

Why `"show_as" => {"show_as" => "check_box}` and not `"show_as" => "check_box"`?

---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1316#note_41773978
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/9ab07cd8/attachment-0001.html>


More information about the Noosfero-dev mailing list