Okay
  Public Ticket #2378080
count frequency of values in a row
Closed

Comments

  • adnaan qureshi started the conversation

    Hi

    My CSV data consists of survey questions. the titles of the question are row0.

    Each subsequent row is numbers from 0-5, for every question/column.

    I need to create a chart for each individual question showing the FREQUENCY of each of the possible responses (0-5) for that question.

    I like your plugin and i am keen to purchase but in the docs i can't find anything about a feature where the frequency of a value can be charted.

  •  2,572
    Aleksandar replied

    Hello adnaan

    Thank you for your interest in wpDataTables

    You would need to have a value the survey marks, like an X, that is going to be used as a measuring point. Then, that column will be included along with a new integer column, which will always have a "1" as a value.

    That "1" is used to count how many times X has been encountered in the table, and when you enable "Grouping" in the chart, you will be able to see how many times X was used for response "1", response "2", response "3", etc.

    Please feel free to play around with our sandbox site to see how it all works.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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

  • adnaan qureshi replied

    hello thanks for your quick reply. 

    Having had a good look through all the setting options, the only option which I can find is “grouping” but that only groups rows by a chosen column. 

    I cannot follow your instructions. 

    Do you have some examples or more detailed tutorials on how to achieve this counting function? 

    Thank you

  •  2,572
    Aleksandar replied

    I'm sorry Adnaan, but no.

    The grouping option I mentioned was for charts, not tables.

    I understood you wanted to create a chart? For the chart to have a grouping function, you need to create a table, as explained in my previous response:

    Can you send me the csv file, so I can see what I can do with it?

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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

  • adnaan qureshi replied

    hello 

    You are correct - I want to create charts. 

    I have attached sample data. There are several question columns which contains 0-5 responses. Each row is a separate response. I need a pie chart for each question, which shows the total number of each response, 0-5. 
    so for every question, we can see how many scored 1, for example. 

  •  2,572
    Aleksandar replied

    Hello again Adnaan

    Unfortunately, with this structure you won't be able to create a chart that you wish to create.

    You would need to have each grade as a column (0 - 5), and questions listed in the first column. So first question is in the first row of the table

    7080334970.png

    I'm afraid you won't be able to create a chart like that with the plugin's built in features, as you would need to duplicate the questions for every entry. 

    Every new survey would be the same list of questions repeated in new rows, where customer would add an "X" in a row where the answer would correspond. Like this:

    8853734051.png

    The counter column would group the rows allowing you to group the values.

    However, I don't believe this would be useful for your use case.

    So, for a custom solution you can check in our documentation about wpDataCharts callbacks

    • Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. wpDataChart callbacks allow adding options that are available in Google Charts APIHighcharts API and Chart.js API
    • All necessary resources are available in charts engines API (depends on which one you use). Every engine has a different approach to chart settings. In wpDataChart callbacks you have to adopt those settings to the wpDataChart object (you can take a look at examples for each engine in our documentation, and also in Support help center). Huge number of examples for any area of programming can be found on stackoverflow.com (typing your problem in google and at the end add "site: stackoverflow.com" and google will search only that website). Also, a lot of examples of charts, chart settings and customization can be found on jsffidle.net (typing in google for example "line chart highcharts jsffidle")
    • Please note that using hooks or wpdatatable and wpDataChart callbacks requires certain level of programming skills and included support refers only to advice.


    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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