Okay
  Public Ticket #3588972
Charts
Closed

Comments

  • Barry P. Schoedel started the conversation

    Hi, when I select two string data types for a chart, it says I have chosen different data types. Please see the image. They were both dropdowns in a Gravity Form. What also doesn't make sense is only one column is required for a donut, basically showing the different choices of the dropdown in reference to one another. Why are columns required? That doesn't make sense. Also, I selected equivalent datatypes but it won't recognize them as such.

    9755306773.png


  •  1,846
    Miloš replied



    Hi Barry,

    For any chart you try to create, there has to be at least two Columns included.

    The first Column you choose will be used for the 'data labels' and the second Column must be numerical.

    The numerical Column provides the series Data.


    Any Chart type you choose ( not only in our Plugin, but that is how Chart engines work) is not going to allow you to have more than one "String/or Date" type Column in it.


    For example, let's take the Google Chart Engine's Donut Chart.

    As we explained on this Documentation for that Chart type;

    it is similar to a Pie Chart ( Which has a strict requirement for exactly 2 Columns, same here) , it just has an empty inner part visually so it looks different, but the functionality and logic is the same.

    2477841746.png


    So the first Column you choose, will provide the names for each slice.

    Like on our example "Dogs, Cats, Fish" and so on...

    And the second Column is numerical ( integer or Float) , then the Chart takes the Total of all values from that Numerical Column as 100% and it 'rounds up' all the numbers as percentages.


    - Can you please show me more details with screenshots or a Video, how does your Gravity Form look;

    how do the Fields look which you wish to use;

    a couple of Entries;


    - How does the connected Table look in our Plugin with the Column structure;

    Do you have any numerical data coming from the Form, or maybe you wish to see how many time each "choice" repeats from the Form?


    If you wish to create a solution that shows something like a "Survey", and how many times each choice repeats on a Chart, I will show you a workaround use-case.


    This is an example where a user needed to make a Survey Gravity Form, and each user would have multiple choices,

    which gets saved by the Form,

    they wanted to make a summed-up Chart that shows how many times each choice will repeat.

    ( It can be used for a Pie Chart/or Donut chart)

    -

    We solve this by adding a hidden number field to the Gravity Form,

    that will always have a predefined value of 1 to prepopulate every row of data, and it will be used as a "counter" for how many times each choice will repeat.

    Here is my basic example, I have a multi-select field in a Gravity Form, 

    and we add a hidden number field :

    1476878896.png

    Then I made a few 'dummy' choices by the test visitors, on the page with the Form to populate some data.

    This is how the linked table looks on my Plugin:

    8607598731.png

    Now, we will make a chart , and we enable "Chart Grouping" , so that all values that have the same value will group up to add up how many times they repeat  for the chart.

    Here is an example of a pie chart from the data,

    3833896169.png

    and here is an example with a Bar chart

    1645498782.png

    So, now you just need to re-structure your Form and have different type of Fields on it to achieve this.

    I presume you have multiple Fields as dropdowns?

    Can you try making one Field with "multiple choices" in the dropdown - so then you will be able to use it in a Chart as on my examples?

    -


    If you need to have multiple Fields as 'multi selection dropdown', then each of them is saved as "String data" - you can use only one per each Chart.

    The only solution for that is, to arrange multiple Charts close to each other, since no Chart can take more than one "String" Column in it.


    I hope that helps.

     Let me know how it goes and if you have any additional questions.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables