I want to use google charts to create a graph that looks like this:
GoogleChart.pie_400x200('Taco Bell'=>0,'Mediterranean'=>2,'Shivas'=>5)
Given the object say Results (name, count). How to create an object for the GoogleCharts structure as shown above?
thanks
Starting with the Results object that you indicated as @results in your comment, the following should work:
@results
GoogleChart.pie_400x200(@results.map {|r| { r[:title] => r[:percentage] } })
Source: https://habr.com/ru/post/891578/More articles:How can I list only folders in a zip archive in Python? - pythonAlternate indentation display in Vim - vimIs it possible to have an SQL table with more than a million columns? - sqlHow to set various effects in nivo-slider - javascriptTinyMCE extended_valid_elements doesn't seem to do this - jqueryStack management with Lua and C ++ - c ++PHP mail () Multipart / Alternative for HTML and plain text messages - phphttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/891581/messagequeueexception-0x80004005-access-to-message-queuing-system-is-denied&usg=ALkJrhgWLh8INyYFOumQXOBNpthg7hGZ3Astop Response.Redirect from encoding - .netrun console application in C # with parameters - c #All Articles