|
1 | | -using Microsoft.AspNetCore.Mvc; |
2 | | -using Microsoft.AspNetCore.Mvc.RazorPages; |
3 | | -using Syncfusion.EJ2.CircularGauge; |
4 | | -namespace AnnotationandLegendSample.Pages |
5 | | -{ |
6 | | - public class SubGaugeModel : PageModel |
7 | | - { |
8 | | - public void OnGet() |
9 | | - { |
10 | | - } |
11 | | - } |
12 | | - public class HomeController : Controller |
13 | | - { |
14 | | - public IActionResult Index() |
15 | | - { |
16 | | - List<CircularGaugeRange> ranges = new List<CircularGaugeRange>(); |
17 | | - CircularGaugeRange range1 = new CircularGaugeRange(); |
18 | | - range1.Start = 0; |
19 | | - range1.End = 3; |
20 | | - range1.Color = "rgba(29,29,29,0.7)"; |
21 | | - ranges.Add(range1); |
22 | | - CircularGaugeRange range2 = new CircularGaugeRange(); |
23 | | - range2.Start = 3; |
24 | | - range2.End = 12; |
25 | | - range2.Color = "rgba(168,145,102,0.1)"; |
26 | | - ranges.Add(range2); |
27 | | - ViewBag.ranges = ranges; |
28 | | - List<CircularGaugeAnnotation> annotations = new List<CircularGaugeAnnotation>(); |
29 | | - CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); |
30 | | - annotation1.Angle = 270; |
31 | | - annotation1.Radius = "40%"; |
32 | | - annotation1.Content = "<div id=subGauge2 style=width: 90px; height: 90px;></div>"; |
33 | | - annotations.Add(annotation1); |
34 | | - CircularGaugeAnnotation annotation2 = new CircularGaugeAnnotation(); |
35 | | - annotation2.Angle = 90; |
36 | | - annotation2.Radius = "40%"; |
37 | | - annotation2.Content = "<div id=time><span>6:30 PM</span></div>"; |
38 | | - annotations.Add(annotation2); |
39 | | - ViewBag.annotations = annotations; |
40 | | - List<CircularGaugePointer> pointers = new List<CircularGaugePointer>(); |
41 | | - CircularGaugePointer pointer1 = new CircularGaugePointer(); |
42 | | - pointer1.PointerWidth = 5; |
43 | | - pointer1.Radius = "40%"; |
44 | | - pointer1.Value = 6.5; |
45 | | - pointer1.Border = new CircularGaugeBorder |
46 | | - { |
47 | | - Width = 1, |
48 | | - Color = "rgb(29,29,29)" |
49 | | - }; |
50 | | - pointer1.Cap = new CircularGaugeCap |
51 | | - { |
52 | | - Color = "rgb(29,29,29)", |
53 | | - Radius = 0, |
54 | | - Border = new CircularGaugeBorder |
55 | | - { |
56 | | - Width = 0.2, |
57 | | - Color = "red" |
58 | | - } |
59 | | - }; |
60 | | - pointer1.NeedleTail = new CircularGaugeNeedleTail |
61 | | - { |
62 | | - Length = "0%" |
63 | | - }; |
64 | | - pointer1.Animation = new CircularGaugeAnimation { Enable = false }; |
65 | | - pointers.Add(pointer1); |
66 | | - CircularGaugePointer pointer2 = new CircularGaugePointer(); |
67 | | - pointer2.PointerWidth = 5; |
68 | | - pointer2.Radius = "60%"; |
69 | | - pointer2.Color = "rgb(29,29,29)"; |
70 | | - pointer2.Value = 6; |
71 | | - pointer2.Border = new CircularGaugeBorder |
72 | | - { |
73 | | - Width = 1, |
74 | | - Color = "rgb(29,29,29)" |
75 | | - }; |
76 | | - pointer2.Cap = new CircularGaugeCap |
77 | | - { |
78 | | - Color = "rgb(29,29,29)", |
79 | | - Radius = 0, |
80 | | - Border = new CircularGaugeBorder |
81 | | - { |
82 | | - Width = 0.2, |
83 | | - Color = "red" |
84 | | - } |
85 | | - }; |
86 | | - pointer2.NeedleTail = new CircularGaugeNeedleTail |
87 | | - { |
88 | | - Length = "0%" |
89 | | - }; |
90 | | - pointer2.Animation = new CircularGaugeAnimation { Enable = false }; |
91 | | - pointers.Add(pointer2); |
92 | | - CircularGaugePointer pointer3 = new CircularGaugePointer(); |
93 | | - pointer3.PointerWidth = 4; |
94 | | - pointer3.Radius = "70%"; |
95 | | - pointer3.Color = "rgba(168,145,102,1)"; |
96 | | - pointer3.Value = 9.8; |
97 | | - pointer3.Cap = new CircularGaugeCap |
98 | | - { |
99 | | - Color = "rgba(168,145,102,1)", |
100 | | - Radius = 4, |
101 | | - Border = new CircularGaugeBorder |
102 | | - { |
103 | | - Width = 0.2, |
104 | | - Color = "rgba(168,145,102,1)" |
105 | | - } |
106 | | - }; |
107 | | - pointer3.NeedleTail = new CircularGaugeNeedleTail |
108 | | - { |
109 | | - Color = "rgba(168,145,102,1)", |
110 | | - Length = "20%" |
111 | | - }; |
112 | | - pointer3.Animation = new CircularGaugeAnimation { Enable = false, Duration = 0 }; |
113 | | - pointers.Add(pointer3); |
114 | | - ViewBag.pointers = pointers; |
115 | | - List<CircularGaugeRange> subgaugeranges = new List<CircularGaugeRange>(); |
116 | | - CircularGaugeRange ranges4 = new CircularGaugeRange(); |
117 | | - ranges4.Start = 0; |
118 | | - ranges4.End = 3; |
119 | | - ranges4.StartWidth = "5"; |
120 | | - ranges4.EndWidth = "5"; |
121 | | - ranges4.Color = "rgba(29,29,29,0.7)"; |
122 | | - subgaugeranges.Add(ranges4); |
123 | | - CircularGaugeRange ranges5 = new CircularGaugeRange(); |
124 | | - ranges5.Start = 3; |
125 | | - ranges5.End = 12; |
126 | | - ranges5.StartWidth = "5"; |
127 | | - ranges5.EndWidth = "5"; |
128 | | - ranges5.Color = "rgba(168,145,102,0.1)"; |
129 | | - subgaugeranges.Add(ranges5); |
130 | | - ViewBag.subgauge_ranges = subgaugeranges; |
131 | | - List<CircularGaugePointer> subpointers = new List<CircularGaugePointer>(); |
132 | | - CircularGaugePointer pointer4 = new CircularGaugePointer(); |
133 | | - pointer4.PointerWidth = 2; |
134 | | - pointer4.Radius = "40%"; |
135 | | - pointer4.Animation = new CircularGaugeAnimation { Enable = false }; |
136 | | - pointer4.Color = "rgb(29,29,29)"; |
137 | | - pointer4.Border = new CircularGaugeBorder |
138 | | - { |
139 | | - Width = 1, |
140 | | - Color = "rgb(29,29,29)" |
141 | | - }; |
142 | | - pointer4.Cap = new CircularGaugeCap |
143 | | - { |
144 | | - Color = "rgb(29,29,29)", |
145 | | - Radius = 2, |
146 | | - Border = new CircularGaugeBorder |
147 | | - { |
148 | | - Width = 0.2, |
149 | | - Color = "red" |
150 | | - } |
151 | | - }; |
152 | | - pointer4.NeedleTail = new CircularGaugeNeedleTail |
153 | | - { |
154 | | - Length = "0%" |
155 | | - }; |
156 | | - subpointers.Add(pointer4); |
157 | | - ViewBag.subgauge_pointers = subpointers; |
158 | | - return View(); |
159 | | - } |
160 | | - } |
161 | | -} |
| 1 | +// using Microsoft.AspNetCore.Mvc; |
| 2 | +// using Microsoft.AspNetCore.Mvc.RazorPages; |
| 3 | +// using Syncfusion.EJ2.CircularGauge; |
| 4 | +// namespace AnnotationandLegendSample.Pages |
| 5 | +// { |
| 6 | +// public class SubGaugeModel : PageModel |
| 7 | +// { |
| 8 | +// public void OnGet() |
| 9 | +// { |
| 10 | +// } |
| 11 | +// } |
| 12 | +// public class HomeController : Controller |
| 13 | +// { |
| 14 | +// public IActionResult Index() |
| 15 | +// { |
| 16 | +// List<CircularGaugeRange> ranges = new List<CircularGaugeRange>(); |
| 17 | +// CircularGaugeRange range1 = new CircularGaugeRange(); |
| 18 | +// range1.Start = 0; |
| 19 | +// range1.End = 3; |
| 20 | +// range1.Color = "rgba(29,29,29,0.7)"; |
| 21 | +// ranges.Add(range1); |
| 22 | +// CircularGaugeRange range2 = new CircularGaugeRange(); |
| 23 | +// range2.Start = 3; |
| 24 | +// range2.End = 12; |
| 25 | +// range2.Color = "rgba(168,145,102,0.1)"; |
| 26 | +// ranges.Add(range2); |
| 27 | +// ViewBag.ranges = ranges; |
| 28 | +// List<CircularGaugeAnnotation> annotations = new List<CircularGaugeAnnotation>(); |
| 29 | +// CircularGaugeAnnotation annotation1 = new CircularGaugeAnnotation(); |
| 30 | +// annotation1.Angle = 270; |
| 31 | +// annotation1.Radius = "40%"; |
| 32 | +// annotation1.Content = "<div id=subGauge2 style=width: 90px; height: 90px;></div>"; |
| 33 | +// annotations.Add(annotation1); |
| 34 | +// CircularGaugeAnnotation annotation2 = new CircularGaugeAnnotation(); |
| 35 | +// annotation2.Angle = 90; |
| 36 | +// annotation2.Radius = "40%"; |
| 37 | +// annotation2.Content = "<div id=time><span>6:30 PM</span></div>"; |
| 38 | +// annotations.Add(annotation2); |
| 39 | +// ViewBag.annotations = annotations; |
| 40 | +// List<CircularGaugePointer> pointers = new List<CircularGaugePointer>(); |
| 41 | +// CircularGaugePointer pointer1 = new CircularGaugePointer(); |
| 42 | +// pointer1.PointerWidth = 5; |
| 43 | +// pointer1.Radius = "40%"; |
| 44 | +// pointer1.Value = 6.5; |
| 45 | +// pointer1.Border = new CircularGaugeBorder |
| 46 | +// { |
| 47 | +// Width = 1, |
| 48 | +// Color = "rgb(29,29,29)" |
| 49 | +// }; |
| 50 | +// pointer1.Cap = new CircularGaugeCap |
| 51 | +// { |
| 52 | +// Color = "rgb(29,29,29)", |
| 53 | +// Radius = 0, |
| 54 | +// Border = new CircularGaugeBorder |
| 55 | +// { |
| 56 | +// Width = 0.2, |
| 57 | +// Color = "red" |
| 58 | +// } |
| 59 | +// }; |
| 60 | +// pointer1.NeedleTail = new CircularGaugeNeedleTail |
| 61 | +// { |
| 62 | +// Length = "0%" |
| 63 | +// }; |
| 64 | +// pointer1.Animation = new CircularGaugeAnimation { Enable = false }; |
| 65 | +// pointers.Add(pointer1); |
| 66 | +// CircularGaugePointer pointer2 = new CircularGaugePointer(); |
| 67 | +// pointer2.PointerWidth = 5; |
| 68 | +// pointer2.Radius = "60%"; |
| 69 | +// pointer2.Color = "rgb(29,29,29)"; |
| 70 | +// pointer2.Value = 6; |
| 71 | +// pointer2.Border = new CircularGaugeBorder |
| 72 | +// { |
| 73 | +// Width = 1, |
| 74 | +// Color = "rgb(29,29,29)" |
| 75 | +// }; |
| 76 | +// pointer2.Cap = new CircularGaugeCap |
| 77 | +// { |
| 78 | +// Color = "rgb(29,29,29)", |
| 79 | +// Radius = 0, |
| 80 | +// Border = new CircularGaugeBorder |
| 81 | +// { |
| 82 | +// Width = 0.2, |
| 83 | +// Color = "red" |
| 84 | +// } |
| 85 | +// }; |
| 86 | +// pointer2.NeedleTail = new CircularGaugeNeedleTail |
| 87 | +// { |
| 88 | +// Length = "0%" |
| 89 | +// }; |
| 90 | +// pointer2.Animation = new CircularGaugeAnimation { Enable = false }; |
| 91 | +// pointers.Add(pointer2); |
| 92 | +// CircularGaugePointer pointer3 = new CircularGaugePointer(); |
| 93 | +// pointer3.PointerWidth = 4; |
| 94 | +// pointer3.Radius = "70%"; |
| 95 | +// pointer3.Color = "rgba(168,145,102,1)"; |
| 96 | +// pointer3.Value = 9.8; |
| 97 | +// pointer3.Cap = new CircularGaugeCap |
| 98 | +// { |
| 99 | +// Color = "rgba(168,145,102,1)", |
| 100 | +// Radius = 4, |
| 101 | +// Border = new CircularGaugeBorder |
| 102 | +// { |
| 103 | +// Width = 0.2, |
| 104 | +// Color = "rgba(168,145,102,1)" |
| 105 | +// } |
| 106 | +// }; |
| 107 | +// pointer3.NeedleTail = new CircularGaugeNeedleTail |
| 108 | +// { |
| 109 | +// Color = "rgba(168,145,102,1)", |
| 110 | +// Length = "20%" |
| 111 | +// }; |
| 112 | +// pointer3.Animation = new CircularGaugeAnimation { Enable = false, Duration = 0 }; |
| 113 | +// pointers.Add(pointer3); |
| 114 | +// ViewBag.pointers = pointers; |
| 115 | +// List<CircularGaugeRange> subgaugeranges = new List<CircularGaugeRange>(); |
| 116 | +// CircularGaugeRange ranges4 = new CircularGaugeRange(); |
| 117 | +// ranges4.Start = 0; |
| 118 | +// ranges4.End = 3; |
| 119 | +// ranges4.StartWidth = "5"; |
| 120 | +// ranges4.EndWidth = "5"; |
| 121 | +// ranges4.Color = "rgba(29,29,29,0.7)"; |
| 122 | +// subgaugeranges.Add(ranges4); |
| 123 | +// CircularGaugeRange ranges5 = new CircularGaugeRange(); |
| 124 | +// ranges5.Start = 3; |
| 125 | +// ranges5.End = 12; |
| 126 | +// ranges5.StartWidth = "5"; |
| 127 | +// ranges5.EndWidth = "5"; |
| 128 | +// ranges5.Color = "rgba(168,145,102,0.1)"; |
| 129 | +// subgaugeranges.Add(ranges5); |
| 130 | +// ViewBag.subgauge_ranges = subgaugeranges; |
| 131 | +// List<CircularGaugePointer> subpointers = new List<CircularGaugePointer>(); |
| 132 | +// CircularGaugePointer pointer4 = new CircularGaugePointer(); |
| 133 | +// pointer4.PointerWidth = 2; |
| 134 | +// pointer4.Radius = "40%"; |
| 135 | +// pointer4.Animation = new CircularGaugeAnimation { Enable = false }; |
| 136 | +// pointer4.Color = "rgb(29,29,29)"; |
| 137 | +// pointer4.Border = new CircularGaugeBorder |
| 138 | +// { |
| 139 | +// Width = 1, |
| 140 | +// Color = "rgb(29,29,29)" |
| 141 | +// }; |
| 142 | +// pointer4.Cap = new CircularGaugeCap |
| 143 | +// { |
| 144 | +// Color = "rgb(29,29,29)", |
| 145 | +// Radius = 2, |
| 146 | +// Border = new CircularGaugeBorder |
| 147 | +// { |
| 148 | +// Width = 0.2, |
| 149 | +// Color = "red" |
| 150 | +// } |
| 151 | +// }; |
| 152 | +// pointer4.NeedleTail = new CircularGaugeNeedleTail |
| 153 | +// { |
| 154 | +// Length = "0%" |
| 155 | +// }; |
| 156 | +// subpointers.Add(pointer4); |
| 157 | +// ViewBag.subgauge_pointers = subpointers; |
| 158 | +// return View(); |
| 159 | +// } |
| 160 | +// } |
| 161 | +// } |
0 commit comments