Example of Circular in ASP.NET MVC ProgressBar Control
Circular
@Html.UiProgressBar(new UiProgressBarOptions { Id = "circular-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Label = "Determinate" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "rtl-container", Type = UiProgressType.Circular, Width = "160px", Value = 70, SecondaryProgress = 90, Label = "Buffer" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "track-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, SegmentCount = 4, Label = "Segment" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "rounded-container", Type = UiProgressType.Circular, Width = "160px", Value = 20, IsIndeterminate = true, Label = "Indeterminate" })
@Html.UiButton(new UiButtonOptions { Id = "reLoad", Text = "Reload", Variant = UiButtonVariant.Outline, Color = UiButtonColor.Primary })
<style>
.pb-wrap { max-width: 760px; margin: 0 auto; padding: 20px 0; }
.pb-label { margin: 18px 0 6px; font-size: 14px; font-weight: 500; }
.pb-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; padding: 20px 0; }
.pb-row figure { margin: 0; text-align: center; }
.pb-row figcaption { margin-top: 8px; font-size: 13px; }
.pb-center { text-align: center; padding: 16px 0; }
.annotaion-pro { font-size: 20px; font-weight: 700; }
</style>
<div class="control-section">
<div class="pb-row">
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "circular-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Label = "Determinate" })<figcaption>Determinate</figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "rtl-container", Type = UiProgressType.Circular, Width = "160px", Value = 70, SecondaryProgress = 90, Label = "Buffer" })<figcaption>Buffer</figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "track-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, SegmentCount = 4, Label = "Segment" })<figcaption>Segment</figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "rounded-container", Type = UiProgressType.Circular, Width = "160px", Value = 20, IsIndeterminate = true, Label = "Indeterminate" })<figcaption>Indeterminate</figcaption></figure>
</div>
<div class="pb-center">@Html.UiButton(new UiButtonOptions { Id = "reLoad", Text = "Reload", Variant = UiButtonVariant.Outline, Color = UiButtonColor.Primary })</div>
</div>
<script>
// Syncfusion: Reload draws the bars again from the start
var values = [100,70,100];
document.getElementById('reLoad').addEventListener('click', function () {
["circular-container","rtl-container","track-container"].forEach(function (id, i) {
var bar = window.Lumen.get(id);
bar.setValue(0);
setTimeout(function () { bar.setValue(values[i]); }, 60);
});
});
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class ProgressBarController : Controller
{
// The page is Views/ProgressBar/Circular.cshtml; it draws what ViewData holds.
public ActionResult Circular()
{
return View();
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
In this example, you can see how to render and configure the circular progress bar. Progress bar is used to visualize the progression of an extended operation. The sample shows the determinate and indeterminate states, buffer and segments of circular progress bar.