Example of Semi Circular in ASP.NET MVC ProgressBar Control
This sample illustrates a circular progress bar with start and end angle customized.
@Html.UiProgressBar(new UiProgressBarOptions { Id = "angle-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 240, EndAngle = 120, ShowProgressValue = true, Label = "Arc from 240 to 120" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "vertical-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 180, EndAngle = 360, ShowProgressValue = true, Label = "Arc from 180 to 360" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "vsemi-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 0, EndAngle = 180, ShowProgressValue = true, Label = "Arc from 0 to 180" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "semi-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 270, EndAngle = 90, ShowProgressValue = true, Label = "Arc from 270 to 90" })
@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 = "angle-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 240, EndAngle = 120, ShowProgressValue = true, Label = "Arc from 240 to 120" })<figcaption></figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "vertical-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 180, EndAngle = 360, ShowProgressValue = true, Label = "Arc from 180 to 360" })<figcaption></figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "vsemi-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 0, EndAngle = 180, ShowProgressValue = true, Label = "Arc from 0 to 180" })<figcaption></figcaption></figure>
<figure>@Html.UiProgressBar(new UiProgressBarOptions { Id = "semi-container", Type = UiProgressType.Circular, Width = "160px", Value = 100, Thickness = 6, StartAngle = 270, EndAngle = 90, ShowProgressValue = true, Label = "Arc from 270 to 90" })<figcaption></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,100,100,100];
document.getElementById('reLoad').addEventListener('click', function () {
["angle-container","vertical-container","vsemi-container","semi-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/SemiCircular.cshtml; it draws what ViewData holds.
public ActionResult SemiCircular()
{
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>
This demo for Essential JS2 Progress Bar control shows the customizing options for angle in circular progress bar. Annotation is enabled in the sample to represent the progress value with animation.