// GET: Customization public ActionResult GaugeCustomization() { List <CircularGaugeAnnotation> annotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); annotation1.Content = "<div style=color:#666666;font-size:35px;>1800</div"; annotation1.Radius = "110%"; annotation1.Angle = 0; annotation1.ZIndex = "1"; annotations.Add(annotation1); ViewBag.Annotations = annotations; // Ranges // List <CircularGaugeRange> ranges = new List <CircularGaugeRange>(); CircularGaugeRange range1 = new CircularGaugeRange(); range1.Start = 1000; range1.End = 2000; range1.StartWidth = "30"; range1.EndWidth = "30"; range1.Radius = "90%"; range1.Color = "#E0E0E0"; ranges.Add(range1); ViewBag.Ranges = ranges; // Pointers // List <CircularGaugePointer> pointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer1 = new CircularGaugePointer(); pointer1.Type = PointerType.RangeBar; pointer1.Value = 1800; pointer1.Radius = "90%"; pointer1.Color = "#FFDD00"; pointer1.Animation = new CircularGaugeAnimation { Duration = 0 }; pointer1.PointerWidth = 30; pointers.Add(pointer1); CircularGaugePointer pointer2 = new CircularGaugePointer(); pointer2.Value = 1800; pointer2.Radius = "90%"; pointer2.Color = "#424242"; pointer2.Animation = new CircularGaugeAnimation { Duration = 0 }; pointer2.PointerWidth = 9; pointer2.Cap = new CircularGaugeCap { Radius = 10, Color = "#424242", Border = new CircularGaugeBorder { Width = 0 } }; pointers.Add(pointer2); ViewBag.Pointers = pointers; return(View()); }
// GET: Ticks public ActionResult TicksAndLabels() { List <CircularGaugeAnnotation> annotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); annotation1.Content = "<div id=content style=color:#518C03;font-size:20px;font-family:Segoe UI;font-weight:semibold;>145</div>"; annotation1.Radius = "0%"; annotation1.Angle = 0; annotation1.ZIndex = "1"; annotations.Add(annotation1); ViewBag.Annotations = annotations; // Ranges // List <CircularGaugeRange> ranges = new List <CircularGaugeRange>(); CircularGaugeRange range1 = new CircularGaugeRange(); range1.Start = 0; range1.End = 145; range1.Radius = "60%"; range1.Color = "#8BC34A"; ranges.Add(range1); ViewBag.Ranges = ranges; // Pointers // List <CircularGaugePointer> pointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer1 = new CircularGaugePointer(); pointer1.PointerWidth = 0; pointer1.NeedleTail = new CircularGaugeNeedleTail { Color = "transparent", Length = "0%" }; ViewBag.Pointers = pointers; return(View()); }
// GET: Range public ActionResult Range() { // Annotations // List <CircularGaugeAnnotation> annotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); annotation1.Content = "<div><span style=font-size:14px; color:#9E9E9E; font-family:Regular>Speedometer</span></div>"; annotation1.Radius = "30%"; annotation1.Angle = 0; annotation1.ZIndex = "1"; annotations.Add(annotation1); CircularGaugeAnnotation annotation2 = new CircularGaugeAnnotation(); annotation2.Content = "<div><span style=font-size:20px; color:#424242; font-family:Regular>65 MPH</span></div>"; annotation2.Radius = "40%"; annotation2.Angle = 180; annotation2.ZIndex = "1"; annotations.Add(annotation2); ViewBag.Annotations = annotations; //Pointers // List <CircularGaugePointer> pointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer1 = new CircularGaugePointer(); pointer1.Value = 65; pointer1.Radius = "60%"; pointer1.PointerWidth = 8; pointer1.Cap = new CircularGaugeCap { Radius = 7 }; pointer1.NeedleTail = new CircularGaugeNeedleTail { Length = "18%" }; pointers.Add(pointer1); ViewBag.Pointers = pointers; // Ranges // List <CircularGaugeRange> ranges = new List <CircularGaugeRange>(); CircularGaugeRange range1 = new CircularGaugeRange(); range1.Start = 0; range1.End = 40; range1.Color = "#30B32D"; ranges.Add(range1); CircularGaugeRange range2 = new CircularGaugeRange(); range2.Start = 40; range2.End = 80; range2.Color = "#FFDD00"; ranges.Add(range2); CircularGaugeRange range3 = new CircularGaugeRange(); range3.Start = 80; range3.End = 120; range3.Color = "#F03E3E"; ranges.Add(range3); ViewBag.Ranges = ranges; return(View()); }
// GET: Image public ActionResult PointerImage() { // Annotations // List <CircularGaugeAnnotation> annotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); annotation1.Content = "12 M"; annotation1.Radius = "108%"; annotation1.Angle = 98; annotation1.ZIndex = "1"; annotations.Add(annotation1); CircularGaugeAnnotation annotation2 = new CircularGaugeAnnotation(); annotation2.Content = "11 M"; annotation2.Radius = "80%"; annotation2.Angle = 81; annotation2.ZIndex = "1"; annotations.Add(annotation2); CircularGaugeAnnotation annotation3 = new CircularGaugeAnnotation(); annotation3.Content = "10 M"; annotation3.Radius = "50%"; annotation3.Angle = 69; annotation3.ZIndex = "1"; annotations.Add(annotation3); CircularGaugeAnnotation annotation4 = new CircularGaugeAnnotation(); annotation4.Content = "Doe"; annotation4.Radius = "108%"; annotation4.Angle = 190; annotation4.ZIndex = "1"; annotations.Add(annotation4); CircularGaugeAnnotation annotation5 = new CircularGaugeAnnotation(); annotation5.Content = "Almaida"; annotation5.Radius = "80%"; annotation5.Angle = 185; annotation5.ZIndex = "1"; annotations.Add(annotation5); CircularGaugeAnnotation annotation6 = new CircularGaugeAnnotation(); annotation6.Content = "John"; annotation6.Radius = "50%"; annotation6.Angle = 180; annotation6.ZIndex = "1"; annotations.Add(annotation6); ViewBag.Annotations = annotations; // Ranges // List <CircularGaugeRange> ranges = new List <CircularGaugeRange>(); CircularGaugeRange range1 = new CircularGaugeRange(); range1.Start = 0; range1.End = 12; range1.Radius = "115%"; range1.Color = "#01aebe"; range1.StartWidth = "25"; range1.EndWidth = "25"; ranges.Add(range1); CircularGaugeRange range2 = new CircularGaugeRange(); range2.Start = 0; range2.End = 11; range2.Radius = "85%"; range2.Color = "#3bceac"; range2.StartWidth = "25"; range2.EndWidth = "25"; ranges.Add(range2); CircularGaugeRange range3 = new CircularGaugeRange(); range3.Start = 0; range3.End = 10; range3.Radius = "55%"; range3.Color = "#ee4266"; range3.StartWidth = "25"; range3.EndWidth = "25"; ranges.Add(range3); ViewBag.Ranges = ranges; return(View()); }
// GET: PointerCustom public ActionResult PointerCustomization() { // First gauge // List <CircularGaugePointer> firstPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer1 = new CircularGaugePointer(); pointer1.Radius = "100%"; pointer1.Value = 80; pointer1.Type = PointerType.Marker; pointer1.MarkerShape = GaugeShape.InvertedTriangle; pointer1.MarkerHeight = 15; pointer1.MarkerWidth = 15; pointer1.Color = "rgb(0,171,169)"; firstPointers.Add(pointer1); ViewBag.FirstPointers = firstPointers; List <CircularGaugeAnnotation> firstAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); annotation1.Angle = 180; annotation1.ZIndex = "1"; annotation1.Radius = "20%"; annotation1.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Inverted Triangle</div>"; firstAnnotations.Add(annotation1); ViewBag.FirstAnnotations = firstAnnotations; // Second Gauge // List <CircularGaugeAnnotation> secondAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation2 = new CircularGaugeAnnotation(); annotation2.Angle = 180; annotation2.ZIndex = "1"; annotation2.Radius = "20%"; annotation2.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Range Bar</div"; secondAnnotations.Add(annotation2); ViewBag.SecondAnnotations = secondAnnotations; List <CircularGaugePointer> secondPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer2 = new CircularGaugePointer(); pointer2.Radius = "90%"; pointer2.Value = 66; pointer2.Type = PointerType.RangeBar; pointer2.Color = "#ff5985"; pointer2.PointerWidth = 10; pointer2.Animation = new CircularGaugeAnimation { Enable = true, Duration = 1000 }; secondPointers.Add(pointer2); ViewBag.SecondPointers = secondPointers; // Third Gauge // List <CircularGaugeAnnotation> thirdAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation3 = new CircularGaugeAnnotation(); annotation3.Angle = 180; annotation3.ZIndex = "1"; annotation3.Radius = "20%"; annotation3.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Triangle</div"; thirdAnnotations.Add(annotation3); ViewBag.ThirdAnnotations = thirdAnnotations; List <CircularGaugePointer> thirdPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer3 = new CircularGaugePointer(); pointer3.Radius = "100%"; pointer3.Value = 70; pointer3.Type = PointerType.Marker; pointer3.MarkerShape = GaugeShape.Triangle; pointer3.MarkerHeight = 15; pointer3.MarkerWidth = 15; pointer3.Color = "#1E7145"; pointer3.PointerWidth = 10; pointer3.Border = new CircularGaugeBorder { Width = 1, Color = "#1E7145" }; pointer3.Animation = new CircularGaugeAnimation { Enable = true, Duration = 1000 }; thirdPointers.Add(pointer3); ViewBag.ThirdPointers = thirdPointers; // Fourth gauge // List <CircularGaugeAnnotation> fourthAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation4 = new CircularGaugeAnnotation(); annotation4.Angle = 180; annotation4.ZIndex = "1"; annotation4.Radius = "20%"; annotation4.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Needle</div"; fourthAnnotations.Add(annotation4); ViewBag.FourthAnnotations = fourthAnnotations; List <CircularGaugePointer> fourthPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer4 = new CircularGaugePointer(); pointer4.Radius = "100%"; pointer4.Value = 70; pointer4.PointerWidth = 6; pointer4.Color = "#923C99"; pointer4.PointerWidth = 10; pointer4.Cap = new CircularGaugeCap { Radius = 0, Color = "transparent" }; pointer4.NeedleTail = new CircularGaugeNeedleTail { Length = "4%", Color = "#923C99" }; pointer4.Animation = new CircularGaugeAnimation { Enable = true, Duration = 900 }; fourthPointers.Add(pointer4); ViewBag.FourthPointers = fourthPointers; // Fifth gauge // List <CircularGaugeAnnotation> fifthAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation5 = new CircularGaugeAnnotation(); annotation5.Angle = 180; annotation5.ZIndex = "1"; annotation5.Radius = "20%"; annotation5.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Multiple Needle</div"; fifthAnnotations.Add(annotation5); ViewBag.FifthAnnotations = fifthAnnotations; List <CircularGaugePointer> fifthPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer5_1 = new CircularGaugePointer(); pointer5_1.Radius = "80%"; pointer5_1.Value = 80; pointer5_1.MarkerHeight = 5; pointer5_1.MarkerWidth = 5; pointer5_1.Color = "#ffb133"; pointer5_1.PointerWidth = 10; pointer5_1.Cap = new CircularGaugeCap { Radius = 8, Color = "white", Border = new CircularGaugeBorder { Color = "#ffb133", Width = 1 } }; pointer5_1.NeedleTail = new CircularGaugeNeedleTail { Length = "20%", Color = "#ffb133" }; pointer5_1.Animation = new CircularGaugeAnimation { Enable = true, Duration = 1000 }; fifthPointers.Add(pointer5_1); CircularGaugePointer pointer5_2 = new CircularGaugePointer(); pointer5_2.Radius = "60%"; pointer5_2.Value = 40; pointer5_2.MarkerHeight = 5; pointer5_2.MarkerWidth = 5; pointer5_2.Color = "#ffb133"; pointer5_2.PointerWidth = 10; pointer5_2.Cap = new CircularGaugeCap { Radius = 8, Color = "white", Border = new CircularGaugeBorder { Color = "#ffb133", Width = 1 } }; pointer5_2.NeedleTail = new CircularGaugeNeedleTail { Length = "20%", Color = "#ffb133" }; pointer5_2.Animation = new CircularGaugeAnimation { Enable = true, Duration = 1000 }; fifthPointers.Add(pointer5_2); ViewBag.FifthPointers = fifthPointers; // Sixth gauge // List <CircularGaugeAnnotation> sixthAnnotations = new List <CircularGaugeAnnotation>(); CircularGaugeAnnotation annotation6 = new CircularGaugeAnnotation(); annotation6.Angle = 180; annotation6.ZIndex = "1"; annotation6.Radius = "20%"; annotation6.Content = "<div style=color:#757575; font-family:Roboto; font-size:14px;>Live Update</div"; sixthAnnotations.Add(annotation6); ViewBag.SixthAnnotations = sixthAnnotations; List <CircularGaugePointer> sixthPointers = new List <CircularGaugePointer>(); CircularGaugePointer pointer6_1 = new CircularGaugePointer(); pointer6_1.Radius = "100%"; pointer6_1.Value = 40; pointer6_1.Color = "#067bc2"; pointer6_1.PointerWidth = 6; pointer6_1.Cap = new CircularGaugeCap { Radius = 0, Color = "transparent" }; pointer6_1.NeedleTail = new CircularGaugeNeedleTail { Length = "4%", Color = "#067bc2" }; pointer6_1.Animation = new CircularGaugeAnimation { Enable = true, Duration = 900 }; sixthPointers.Add(pointer6_1); CircularGaugePointer pointer6_2 = new CircularGaugePointer(); pointer6_2.Radius = "100%"; pointer6_2.Type = PointerType.RangeBar; pointer6_2.Value = 40; pointer6_2.PointerWidth = 6; pointer6_2.Color = "#067bc2"; pointer6_2.Animation = new CircularGaugeAnimation { Enable = true, Duration = 900 }; sixthPointers.Add(pointer6_2); ViewBag.SixthPointers = sixthPointers; return(View()); }