BulletGraph
範囲の使用
機能
サンプル
設定
説明
この例は、BulletGraph で範囲を使用する方法を示します。
ソース
RangesController.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 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;
}
@(Html.C1().BulletGraph().Id(demoSettingsModel.ControlId)
.Min(0).Max(10).Good(3)
.Bad(4).Target(6).Value(1)
.Ranges(items => items
.Add(item => item.Min(2).Max(3).Color(System.Drawing.Color.Green))
.Add(item => item.Min(6).Max(9).Color(System.Drawing.Color.Yellow))
)
.Width(500)
)
@section Description{
@Html.Raw(Resources.BulletGraph.Ranges_Text0)
}
マニュアル