LinearGauge
Displaying Values
Features
Sample
Settings
Description
This example demonstrates how to use the showText property with the LinearGauge control.
Source
ShowTextController.cs
using MvcExplorer.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MvcExplorer.Controllers
{
public partial class LinearGaugeController : Controller
{
public ActionResult ShowText()
{
ViewBag.DemoSettings = true;
ViewBag.DemoSettingsModel = new ClientSettingsModel
{
Settings = CreateShowTextSettings()
};
return View();
}
private static IDictionary<string, object[]> CreateShowTextSettings()
{
var settings = new Dictionary<string, object[]>
{
{"ShowText", new object[]{"All", "Value", "MinMax", "None"}}
};
return settings;
}
}
}
ShowText.cshtml
@{
ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
@(Html.C1().LinearGauge().Id(demoSettingsModel.ControlId)
.Min(0).Max(10).Value(5)
.ShowText(ShowText.All).Width(500)
)
@section Description{
@Html.Raw(Resources.LinearGauge.ShowText_Text)
}
Documentation