Multiple Items in EJ 1 ASP.NET MVC DigitalGauge
18 Nov 2017 / 1 minute to read
The text in the Digital Gauge is positioned with position object. This object contains two attributes such as x
and y
. The x
variable positions the text in the horizontal axis and y
variable positions the text in the vertical axis.
@(Html.EJ().DigitalGauge("DigitalGauge1")
// For setting Width and Height
.Width(1300).Height(300)
.Frame(fr=>fr.BackgroundImageUrl("../Content/images/gauge/Board1.jpg"))
.Items(it =>
{
// For setting Item1
it.Value("YELLOW").SegmentSettings(cs =>
cs.Color("Yellow")).Position(position=>position.X(80).Y(0)).Add();
// For setting Item2
it.Value("RED").SegmentSettings(cs =>
cs.Color("Red")).Position(position => position.X(80).Y(20)).Add();
// For setting Item3
it.Value("GREEN").SegmentSettings(cs =>
cs.Color("Green")).Position(pos => pos.X(80).Y(40)).Add();
}))
Execute the above code example to render the DigitalGauge as follows.
Digital Gauge control with multiple items
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page