Percentage Progress Bar
To help respondents keep track of answered and unanswered questions, your survey can display a progress bar that indicates a percentage of survey completion. Follow the instructions below to implement the percentage progress bar in your application:
Create a custom component that renders the progress bar.
You can implement the progress bar based on a simple<div>element. Fill this<div>with color depending onSurveyModel'sprogressValueproperty value.Display a percentage value and a title.
A percentage value is already stored in theprogressValueproperty. To store the title, you need to create a custom property—progressTitle. CallSerializer'saddPropertymethod to add the property to the survey. Then, specify the property value in the survey JSON schema.Register the custom component so that it can be accessed by name.
In HTML/CSS/JavaScript projects, register the component inReactElementFactoryas shown in theindex.jsfile.
In React, register the component inReactElementFactoryas shown in theSurveyComponent.jsxfile.
In Angular, register the component inAngularComponentFactoryas shown in theprogressbar-percentage.component.tsfile.
In Vue.js, use techniques native to this framework.Add the progress bar to the survey layout.
Call theaddLayoutElementmethod. It accepts an object whose properties specify the element'sid, acontainerthat determines the element's location, acomponentthat renders the element, anddatato pass as component props. Refer to the method description for more information on these properties.