LinearGauge
Editing Values
Features
Sample
Settings
Description
This example demonstrates how to use the isReadOnly and step properties with the LinearGauge controls.
ShowTicks: determines whether the gauge should display tickmarks at each step or tickSpacing value.
ShowTickText: determines whether the gauge should display the text value of each tick mark.
ShowTicks: determines whether the gauge should display tickmarks at each step or tickSpacing value.
ShowTickText: determines whether the gauge should display the text value of each tick mark.
Source
EditingController.cs
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using MvcExplorer.Models;
namespace MvcExplorer.Controllers
{
public partial class LinearGaugeController : Controller
{
public ActionResult Editing()
{
ViewBag.DemoSettings = true;
ViewBag.DemoSettingsModel = new ClientSettingsModel
{
Settings = CreateEditingSettings()
};
return View();
}
private static IDictionary<string, object[]> CreateEditingSettings()
{
var settings = new Dictionary<string, object[]>
{
{"IsReadOnly", new object[]{false, true }},
{"Step", new object[]{0.5, 1, 2}},
{"ShowTicks", new object[]{ false, true}},
{"ShowTickText", new object[]{ false, true}}
};
return settings;
}
}
}
Editing.cshtml
@{
ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
@section Styles{
<style>
.wj-gauge .wj-tick-text text {
opacity: 1;
font-family: Courier;
font-size: 8pt;
fill: purple;
}
</style>
}
<br />
<c1-linear-gauge id="@demoSettingsModel.ControlId" min="0" max="10" value="5" format="" show-text="All" is-read-only="false" step="0.5" width="500px"
show-ticks="false" show-tick-text="false">
</c1-linear-gauge>
@section Description{
@Html.Raw(LinearGaugeRes.Editing_Text0)
<br />
@Html.Raw(LinearGaugeRes.Editing_Text1)
<br />
@Html.Raw(LinearGaugeRes.Editing_Text2)
}
Documentation