Help us shape the 2021 DevExtreme Roadmap. Take our 5 minute survey.
Dismiss
Your search did not match any results.
Bar Gauge

Labels Customization

Documentation

This demo shows how to adjust the label appearance in the BarGauge UI component. For this purpose, the properties of the label object are used. You can specify format and precision, customize the text displayed by labels using the format, precision and customizeText properties, respectively. In addition, you can change the distance between labels and the upper gauge bar using the indent property.

@(Html.DevExtreme().BarGauge() .ID("gauge") .StartValue(0) .EndValue(100) .Values(new [] { 47.27, 65.32, 84.59, 71.86 }) .Label(l => l .Indent(30) .Format(f => f.Type(Format.FixedPoint).Precision(1)) .CustomizeText(@<text> function (arg) { return arg.valueText + " %"; } </text>) ) .Export(e => e.Enabled(true)) .Title(t => t .Text("Series' Ratings") .Font(f => f.Size(28)) ) )
using DevExtreme.MVC.Demos.Models.SampleData; using System.Collections.Generic; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class GaugesController : Controller { public ActionResult LabelsCustomization() { return View(); } } }
#gauge { height: 440px; width: 100%; }