Home › forums › Using CanvasJS › Charting the frequency of a value
Tagged: count, frequency
ive looked extensively on the support forum but i cant find an answer.
my csv is simple – row0 is text headings (survey questions). each subsequent row contains answers to the questions, which can either be integer or text depending on the question of that column. The number of possible values in each question is fixed (no survey question is free text).
for each column / question, i just need a pie or bar chart to show how many of each response there is in the whole row.
is there any script that can count the frequency of each response and put that on the graph, rather than just plotting each individual value which is what is happening now.
Can you please share your sample data over Google-Drive or Onedrive and brief us further about your requirement so that we can understand your scenario better and help you out.
Hello. Thank you for your answer.
I have attached a Dropbox link to the data.
Each column is a survey question. Each question has only a certain number of possible answers.
For each column, I need a plugin to count how many times each of the different answers are present, and then plot the count on a pie chart.
So if column name was for example “what is your favourite colour”
And the rows contained
The graph would see that there are 4 different answers and would count each of them.
The pie chart would graph
Sorry for got the link
Counting the number of occurrence of colors and parsing the data in the format accepted by CanvasJS should work fine in your case. Please take a look at this JSFiddle.
You must be logged in to reply to this topic.