Home Forums Chart Support Charting the frequency of a value

Charting the frequency of a value

Viewing 5 posts - 1 through 5 (of 5 total)
  • #29141

    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.
    thanks,

    • This topic was modified 4 years, 6 months ago by billyqureshi.
    #29168

    @billyqureshi,

    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.

    ___________
    Indranil Deo
    Team CanvasJS

    #29185

    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

    Red
    Violet
    Green
    Green
    Red
    Blue
    Pink

    The graph would see that there are 4 different answers and would count each of them.

    The pie chart would graph

    Red:2
    Violet:1
    Green:2
    Blue:1
    Pink:1

    • This reply was modified 4 years, 6 months ago by billyqureshi. Reason: Typing error
    #29186
    #29198

    @billyqureshi,

    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.

    ___________
    Indranil Deo
    Team CanvasJS

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.