BulletGraph
BulletGraph
Using Ranges
Features
Sample
Settings
Description
The example demonstrates how to use ranges with the BulletGraph.
Source
RangesController.cs
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using MvcExplorer.Models;
namespace MvcExplorer.Controllers
{
public partial class BulletGraphController : Controller
{
public ActionResult Ranges()
{
ViewBag.DemoSettings = true;
ViewBag.DemoSettingsModel = new ClientSettingsModel
{
Settings = CreateShowRangesSettings()
};
return View();
}
private static IDictionary<string, object[]> CreateShowRangesSettings()
{
var settings = new Dictionary<string, object[]>
{
{"ShowRanges", new object[]{true, false}}
};
return settings;
}
}
}
Ranges.cshtml
@{
ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
<c1-bullet-graph id="@demoSettingsModel.ControlId" min="0" max="10" good="3" bad="4" value="1" target="6" width="500px">
<c1-gauge-range min="2" max="3" color="Green"></c1-gauge-range>
<c1-gauge-range min="6" max="9" color="Yellow"></c1-gauge-range>
</c1-bullet-graph>
@section Description{
@Html.Raw(BulletGraphRes.Ranges_Text0)
}
Documentation