SurveyJS Service Results

Get Survey Result after sending results

                        var surveySendResult = function(s, options) {
    if(options.success) {
        s.getResult('a15eee7a-9418-4eb4-9671-2009c8ff6b24', 'langs');
    }
};
var surveyGetResult = function(s, options) {
    if(options.success) {
        showChart(options.dataList);
    }
};
function showChart(chartDataSource) {
    document.getElementById("chartContainer").style.height = "500px";
    $("#chartContainer").dxPieChart({
        dataSource: chartDataSource,
        series: {
            argumentField: 'name',
            valueField: 'value'
        }
    });
}



var json = {
        surveyId: '5af48e08-a0a5-44a5-83f4-1c90e8e98de1',
        surveyPostId: '3ce10f8b-2d8a-4ca2-a110-2994b9e697a1'
};

window.survey = new Survey.Model(json);


survey.onComplete.add(function(result) {
    document.querySelector('#surveyResult').innerHTML = "result: " + JSON.stringify(result.data);
});

survey.onSendResult.add(surveySendResult);
survey.onGetResult.add(surveyGetResult);

survey.render("surveyElement");


                    
<!DOCTYPE html>
<html>
<head>
    <title>Get Survey Result after sending results, Knockoutjs Survey Library Example</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script>
<script src="https://surveyjs.azureedge.net/1.0.60/survey.ko.js"></script>
<link href="https://surveyjs.azureedge.net/1.0.60/survey.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">
<script src="https://cdn3.devexpress.com/jslib/17.2.5/js/dx.all.js"></script>
</head>
<body>
    <div id="chartContainer"></div>            <div id="surveyElement">
            </div>
    <div id="surveyResult"></div>

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

</body>
</html>

The current survey results could be accessible via the direct link. See Survey Results