Search results

Linear Gauge Dimensions in ASP.NET Core Linear Gauge control

14 Apr 2021 / 1 minute to read

Size for Linear Gauge

You can also set size for linear gauge directly through width and height properties.

In Pixel

You can set the size of lineargauge in pixel as demonstrated below.

tagHelper
pixel.cs
Copied to clipboard
@using Syncfusion.EJ2
<ejs-lineargauge id="linear" width="650px" height="350px"></ejs-lineargauge>
Copied to clipboard
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;
using Syncfusion.EJ2.Charts;
using Syncfusion.EJ2.LinearGauge;


namespace EJ2_Core_Application.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {

            return View();
        }
    }
}

In Percentage

By setting value in percentage, linear gauge gets its dimension with respect to its container. For example, when the height is ‘50%’, linear gauge renders to half of the container height.

tagHelper
percentage.cs
Copied to clipboard
@using Syncfusion.EJ2;
<ejs-lineargauge id="linear" width="100%" height="50%"></ejs-lineargauge>
Copied to clipboard
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;
using Syncfusion.EJ2.Charts;
using Syncfusion.EJ2.LinearGauge;


namespace EJ2_Core_Application.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {

            return View();
        }
    }
}

Note: When you do not specify the size, it takes 450px as the height and window size as its width.