Can I define my own range and labels in the Linear Gauge?
Controller:
public ActionResult LinearGauge()
{
List<gaugeSetting> gaugeModel = new List<gaugeSetting>();
gaugeModel.Add(new gaugeSetting { From = 1, To = 2, Color = "#000099", Label = "Requirements" });
gaugeModel.Add(new gaugeSetting { From = 2, To = 3, Color = "#009900", Label = "Design" });
gaugeModel.Add(new gaugeSetting { From = 3, To = 4, Color = "#ff0000", Label = "Development" });
return View(gaugeModel)
}
View:
@(Html.Kendo().LinearGauge()
.Name("gauge")
.Pointer(pointer => pointer
.Value(2)
.Shape(GaugeLinearPointerShape.Arrow)
)
.Scale(scale => scale
.Vertical(false)
.Labels(l =>
{
//Get the Labels from the Model
})
.MajorUnit(1)
.MinorUnit(1)
.Max(7)
.Ranges(ranges =>
{
//Get the Ranges from the Model
}
)
)
.HtmlAttributes(new { style = "width:500px;" })
)
Controller:
public ActionResult LinearGauge()
{
List<gaugeSetting> gaugeModel = new List<gaugeSetting>();
gaugeModel.Add(new gaugeSetting { From = 1, To = 2, Color = "#000099", Label = "Requirements" });
gaugeModel.Add(new gaugeSetting { From = 2, To = 3, Color = "#009900", Label = "Design" });
gaugeModel.Add(new gaugeSetting { From = 3, To = 4, Color = "#ff0000", Label = "Development" });
return View(gaugeModel)
}
View:
@(Html.Kendo().LinearGauge()
.Name("gauge")
.Pointer(pointer => pointer
.Value(2)
.Shape(GaugeLinearPointerShape.Arrow)
)
.Scale(scale => scale
.Vertical(false)
.Labels(l =>
{
//Get the Labels from the Model
})
.MajorUnit(1)
.MinorUnit(1)
.Max(7)
.Ranges(ranges =>
{
//Get the Ranges from the Model
}
)
)
.HtmlAttributes(new { style = "width:500px;" })
)