Try SurveyJS
A robust full-cycle
survey and form solution
for your JavaScript application.
SurveyJS Library
Survey Creator
import { SurveyCreator, SurveyCreatorComponent } from "survey-creator-react";
import "survey-core/defaultV2.min.css";
import "survey-creator-core/survey-creator-core.min.css";
const creatorOptions = {
// ...
};
export function SurveyCreatorWidget() {
const creator = new SurveyCreator(creatorOptions);
return <SurveyCreatorComponent creator={creator} />;
}
SurveyJS Analytics
var json = { ... };
SurveyAnalytics.MatrixPlotly.types = ['stackedbar', 'bar', 'pie', 'doughnut'];
SurveyAnalytics.SelectBasePlotly.types = ['doughnut', 'bar', 'pie', 'scatter'];
const survey = new Survey.Model(json);
const allQuestions = survey.getAllQuestions();
const data = [
{
Quality: {
affordable: "3",
"does what it claims": "4",
"better then others": "5",
"easy to use": "1"
},
organization_type: "In-house",
},
{
Quality: {
affordable: "3",
"does what it claims": "4",
"better then others": "2",
"easy to use": "3",
},
organization_type: "Hobbyist"
},
{
Quality: {
affordable: "3",
"does what it claims": "4",
"better then others": "5",
"easy to use": "1"
},
organization_type: "In-house"
},
];
const visPanel = new SurveyAnalytics.VisualizationPanel(
allQuestions,
data,
{labelTruncateLength: 27}
);
visPanel.showHeader = true;
visPanel.render(surveyResult);
SurveyJS PDF Export
import { SurveyPDF } from "survey-pdf";
function prepareSurveyPDF() {
const surveyPDF = new SurveyPDF(json);
surveyPDF.data = survey.data;
return surveyPDF;
}
function savePdfAsFile() {
const surveyPDF = prepareSurveyPDF();
surveyPDF.save("surveyAsFile.pdf");
}
function savePdfAsBlob() {
const surveyPDF = prepareSurveyPDF();
surveyPDF
.raw("bloburl")
.then(function (bloburl) {
var a = document.createElement("a");
a.href = bloburl;
a.download = "surveyAsBlob.pdf";
document
.body
.appendChild(a);
a.click();
});
}
function previewPdf() {
const surveyPDF = prepareSurveyPDF();
var oldFrame = document.getElementById("pdf-preview-frame");
if (oldFrame)
oldFrame
.parentNode
.removeChild(oldFrame);
surveyPDF
.raw("dataurlstring")
.then(function (dataurl) {
var pdfEmbed = document.createElement("embed");
pdfEmbed.setAttribute("id", "pdf-preview-frame");
pdfEmbed.setAttribute("type", "application/pdf");
pdfEmbed.setAttribute("style", "width:100%");
pdfEmbed.setAttribute("height", 200);
pdfEmbed.setAttribute("src", dataurl);
var previewDiv = document.getElementById("pdf-preview");
previewDiv.appendChild(pdfEmbed);
});
}
document
.getElementById("saveAsFileBtn")
.onclick = function () {
savePdfAsFile();
};
document
.getElementById("saveAsBlobBtn")
.onclick = function () {
savePdfAsBlob();
};
document
.getElementById("pdfPreviewBtn")
.onclick = function () {
previewPdf();
};
Survey management system examples
You can use SurveyJS components to build a full-cycle survey management system integrated with your backend. Your users will be able to create, modify, and run surveys, collect survey results, and analyze them using visualization tools. View examples of such systems for most popular backend frameworks and CMS: