You can categories certain interval on gauge axis using ranges
property.
Start and end value of a range in an axis can be customized by using start
and end
properties.
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-circulargauge-ranges>
<e-circulargauge-range start="40" end="80"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
Color and thickness of the range can be customized by using color
,startWidth
and endWidth
property.
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-circulargauge-ranges>
<e-circulargauge-range start="40" end="80" startWidth="15" endWidth="15" color="#ff5985"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
You can place the range inside or outside of the axis by using radius
property. The radius of the range can takes value either in percentage or in pixels. By default, ranges
take 100% of the axis radius.
In Pixel
You can set the radius of the range in pixel as demonstrated below,
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-circulargauge-ranges>
<e-circulargauge-range start="40" end="80" radius="100"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
In Percentage
By setting value in percentage, range gets its dimension with respect to its axis radius. For example, when the radius is ‘50%’, range renders to half of the axis radius.
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-circulargauge-ranges>
<e-circulargauge-range start="40" end="80" radius="50%"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
The ranges can be dragged over the axis line by clicking and dragging the same. To enable or disable the range drag, use the EnableRangeDrag
property.
You can add multiple ranges to an axis with the above customization as demonstrated below.
Note: You can set the range color to axis ticks and labels by enabling
useRangeColor
property inmajorTicks
,minorTicks
andlabelStyle
object.
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-axis-labelstyle useRangeColor="true"></e-axis-labelstyle>
<e-axis-majorticks useRangeColor="true"></e-axis-majorticks>
<e-axis-minorticks useRangeColor="true"></e-axis-minorticks>
<e-circulargauge-ranges>
<e-circulargauge-range start="0" end="25" radius="108%"></e-circulargauge-range>
<e-circulargauge-range start="25" end="50" radius="70%"></e-circulargauge-range>
<e-circulargauge-range start="50" end="75" radius="70%"></e-circulargauge-range>
<e-circulargauge-range start="75" end="100" radius="108%"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
You can customize the corner radius using the roundedCornerRadius
property in ranges
.
@using Syncfusion.EJ2;
<ejs-circulargauge id="circular">
<e-circulargauge-axes>
<e-circulargauge-axis>
<e-circulargauge-ranges>
<e-circulargauge-range start="40" end="80" roundedCornerRadius="6"></e-circulargauge-range>
</e-circulargauge-ranges>
</e-circulargauge-axis>
</e-circulargauge-axes>
</ejs-circulargauge>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
Gradient support allows to add multiple colors in the ranges and pointers of the circular gauge. The following gradient types are supported in the circular gauge.
Using linear gradient, colors will be applied in a linear progression. The start value of the linear gradient will be set using the startValue
property. The end value of the linear gradient will be set using the endValue
property. The color stop values such as color, opacity and offset are set using colorStop
property.
To apply linear gradient to the range, follow the below code sample.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
Using radial gradient, colors will be applied in circular progression. The inner circle position of the radial gradient will be set using the innerPosition
property. The outer circle position of the radial gradient can be set using the outerPosition
property. The color stop values such as color, opacity and offset are set using colorStop
property.
To apply radial gradient to the range, follow the below code sample.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using EJ2_Core_Application.Models;
using Newtonsoft.Json;
namespace EJ2_Core_Application.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}