Cart Licenses Contact Support Online Creator Log in/Register
Try
Buy
v 1.9.44

Survey Analytics + SurveyJS.IO service

loading...

                        


        
            var json = {
  "elements": [
    {
      "type": "checkbox",
      "name": "langs",
      "title": "What language(s) are you currently using?",
      "colCount": 4,
      "isRequired": true,
      "choices": [ "Javascript", "Java", "Python", "CSS", "PHP", "Ruby", "C++", "C", "Shell", "C#", "Objective-C", "R", "VimL", "Go", "Perl", "CoffeeScript", "TeX", "Swift", "Scala", "Emacs List", "Haskell", "Lua", "Clojure", "Matlab", "Arduino", "Makefile", "Groovy", "Puppet", "Rust", "PowerShell" ],
      "validators": [
        {
          "type": "answercountvalidator",
          "maxCount": 3,
          "text": "Please select maximum three languges."
        }
      ]
    }
  ]
};
        

    // You can set JSON directly
    // var survey = new Survey.Model(json);

    // Or get survey JSON from our service by survey Id
    var jsonWithIds = {
        surveyId: '5af48e08-a0a5-44a5-83f4-1c90e8e98de1',
        surveyPostId: '3ce10f8b-2d8a-4ca2-a110-2994b9e697a1'
    };
    var survey = new Survey.Model(jsonWithIds);

    var surveyResultNode = document.getElementById("surveyResult");
    surveyResultNode.innerHTML = "";

    // Published survey results can be obtained via the https://surveyjs.io/Help/Api/GET-api-MySurveys-getSurveyPublicResults-id_from_till?apiType=private API method using survey ID
    $.get("https://api.surveyjs.io/private/Surveys/getSurveyPublicResults/5af48e08-a0a5-44a5-83f4-1c90e8e98de1", function (data) {
        var visPanel = new SurveyAnalytics.VisualizationPanel(
            survey.getAllQuestions(),
            data.Data,
            { labelTruncateLength: 27 }
        );
        visPanel.showHeader = true;

        $("#loadingIndicator").hide();

        visPanel.render(surveyResultNode);
    });

                    
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Survey Analytics + SurveyJS.IO service, Knockoutjs Survey Library Example</title>
    
<meta name="viewport" content="width=device-width" />
    <script src="https://unpkg.com/jquery"></script>
    <script src="https://unpkg.com/knockout@3.5.1/build/output/knockout-latest.js"></script>
    <script src="/DevBuilds/survey-core/survey.core.min.js"></script>
    <script src="/DevBuilds/survey-core/survey.i18n.min.js"></script>
    <script src="/DevBuilds/survey-knockout-ui/survey-knockout-ui.min.js"></script>
    <link href="/DevBuilds/survey-core/defaultV2.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/master/typedarray.js"></script>

<script src="https://polyfill.io/v3/polyfill.min.js"></script>

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<script src="https://unpkg.com/wordcloud@1.1.0/src/wordcloud2.js"></script>        <link href="/DevBuilds/survey-analytics/survey.analytics.min.css" rel="stylesheet" />
        <script src="/DevBuilds/survey-analytics/survey.analytics.min.js"></script>

</head>
<body style="margin: 0">
    
<div>

</div>

<div id="loadingIndicator">
    <span>
        <div id="loading"><strong>loading...</strong><span></span></div>
    </span>
</div>            <div id="surveyElement" style="display:inline-block;width:100%;">
            </div>
    <div id="surveyResult"></div>

<script type="text/javascript" src="./index.js"></script>

</body>
</html>

Tell Us What You Think

Help us serve you better by taking this brief survey.
We are interested to learn more about your
experience of using our libraries.

We'd really appreciate your feedback.

Start the Survey

Approximate time to complete: 2 min.