1e41f4b71Sopenharmony_ci# Gauge
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **\<Gauge>** component is used to display data in a ring chart.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci>  **NOTE**
7e41f4b71Sopenharmony_ci>
8e41f4b71Sopenharmony_ci>  This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## Child Components
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciThis component can contain only one child component.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci> **NOTE**
16e41f4b71Sopenharmony_ci>
17e41f4b71Sopenharmony_ci> You are advised to use the **\<Text>** component to build the current value and auxiliary text.
18e41f4b71Sopenharmony_ci>
19e41f4b71Sopenharmony_ci> If the width and height of a child component are in percentage, the reference range is the rectangle whose outer ring is used as the inscribed circle.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci## APIs
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ciGauge(options:{value: number, min?: number, max?: number})
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ciCreates a **\<Gauge>** component.
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci**Parameters**
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description |
37e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- |
38e41f4b71Sopenharmony_ci| value | number | Yes | Current value of the gauge, that is, the position to which the indicator points in the gauge. It is used as the initial value of the gauge when it is created.<br>**NOTE**<br>If the value is not within the range defined by the **min** and **max** parameters, the value of **min** is used. |
39e41f4b71Sopenharmony_ci| min | number | No | Minimum value of the current data segment.<br>Default value: **0** |
40e41f4b71Sopenharmony_ci| max | number | No | Maximum value of the current data segment.<br>Default value: **100**<br>**NOTE**<br>If the value of **max** is less than that of **min**, the default values **0** and **100** are used.<br>The values of **max** and **min** can be negative numbers. |
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci## Attributes
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ciIn addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported.
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci### value
47e41f4b71Sopenharmony_ci
48e41f4b71Sopenharmony_civalue(value: number)
49e41f4b71Sopenharmony_ci
50e41f4b71Sopenharmony_ciSets the value of the gauge.
51e41f4b71Sopenharmony_ci
52e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci**Parameters** 
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci| Name | Type  | Mandatory | Description                                                        |
61e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------------------------------ |
62e41f4b71Sopenharmony_ci| value  | number | Yes  | Value of the gauge. It can be dynamically changed.<br>Default value: **0** |
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci### startAngle
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_cistartAngle(angle: number)
67e41f4b71Sopenharmony_ci
68e41f4b71Sopenharmony_ciSets the start angle of the gauge.
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci**Parameters** 
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci| Name | Type  | Mandatory | Description                                                        |
79e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------------------------------ |
80e41f4b71Sopenharmony_ci| angle  | number | Yes  | Start angle of the gauge. The value **0** indicates 0 degrees, and a positive value indicates the clockwise direction.<br>Default value: **0** |
81e41f4b71Sopenharmony_ci
82e41f4b71Sopenharmony_ci### endAngle
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ciendAngle(angle: number)
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ciSets the end angle of the gauge. Ensure an appropriate difference between the start angle and end angle. If this difference is too small, the drawn chart may be abnormal. You are advised to use a monochrome ring to set the **value** attribute of the **\<Gauge>**. You can also use **setTimeout** to delay value loading.
87e41f4b71Sopenharmony_ci
88e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
89e41f4b71Sopenharmony_ci
90e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci**Parameters** 
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ci| Name | Type  | Mandatory | Description                                                        |
97e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------------------------------ |
98e41f4b71Sopenharmony_ci| angle  | number | Yes  | End angle of the gauge. The value **0** indicates 0 degrees, and a positive value indicates the clockwise direction.<br>Default value: **360** |
99e41f4b71Sopenharmony_ci
100e41f4b71Sopenharmony_ci### colors
101e41f4b71Sopenharmony_ci
102e41f4b71Sopenharmony_cicolors(colors: ResourceColor | LinearGradient | Array<[ResourceColor | LinearGradient | number]>)
103e41f4b71Sopenharmony_ci
104e41f4b71Sopenharmony_ciSets the colors of the gauge.
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_ciSince API version 11, this API follows the following rules:
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ciIf the data type is ResourceColor, the ring is of the monochrome type.
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ciIf the data type is LinearGradient, the ring is of the gradient type.
111e41f4b71Sopenharmony_ci
112e41f4b71Sopenharmony_ciIf the data type is Array, the ring is of the gradient type. The first parameter indicates the color value. If it is set to a non-color value, the color of 0xFFE84026 is used. The second parameter indicates the color weight. If it is set to a negative number or a non-numeric value, the color weight is 0.
113e41f4b71Sopenharmony_ci
114e41f4b71Sopenharmony_ciA ring of the gradient type contains a maximum of nine color segments. If there are more than nine segments, the excess is not displayed.
115e41f4b71Sopenharmony_ci
116e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
117e41f4b71Sopenharmony_ci
118e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
119e41f4b71Sopenharmony_ci
120e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
121e41f4b71Sopenharmony_ci
122e41f4b71Sopenharmony_ci**Parameters** 
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci| Name | Type                                                        | Mandatory | Description                                                        |
125e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
126e41f4b71Sopenharmony_ci| colors | [ResourceColor<sup>11+</sup>](ts-types.md#resourcecolor) \| [LinearGradient<sup>11+</sup>](ts-basic-components-datapanel.md#lineargradient10) \| Array&lt;[[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient<sup>11+</sup>](ts-basic-components-datapanel.md#lineargradient10) \| number]&gt; | Yes  | Colors of the gauge. You can set colors for individual segments.<br>Default value in API version 9: **Color.Black**<br>Default value in API version 11:<br>If no color is passed or the passed array is empty, the ring will be a gradient consisting of the following colors: 0xFF64BB5C, 0xFFF7CE00, and 0xFFE84026.<br>If a color is passed but the color value is invalid, the ring will be in the color of 0xFFE84026. |
127e41f4b71Sopenharmony_ci
128e41f4b71Sopenharmony_ci### strokeWidth
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_cistrokeWidth(length: Length)
131e41f4b71Sopenharmony_ci
132e41f4b71Sopenharmony_ciSets the stroke width of the gauge.
133e41f4b71Sopenharmony_ci
134e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9.
135e41f4b71Sopenharmony_ci
136e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
137e41f4b71Sopenharmony_ci
138e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
139e41f4b71Sopenharmony_ci
140e41f4b71Sopenharmony_ci**Parameters** 
141e41f4b71Sopenharmony_ci
142e41f4b71Sopenharmony_ci| Name | Type                        | Mandatory | Description                                                        |
143e41f4b71Sopenharmony_ci| ------ | ---------------------------- | ---- | ------------------------------------------------------------ |
144e41f4b71Sopenharmony_ci| length | [Length](ts-types.md#length) | Yes  | Stroke width of the gauge.<br>Default value: **4**<br>Unit: vp<br>**NOTE**<br>A value less than 0 evaluates to the default value.<br>The value cannot be in percentage. |
145e41f4b71Sopenharmony_ci
146e41f4b71Sopenharmony_ci### description<sup>11+</sup>
147e41f4b71Sopenharmony_ci
148e41f4b71Sopenharmony_cidescription(value: CustomBuilder)
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ciSets the description of the gauge.
151e41f4b71Sopenharmony_ci
152e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
153e41f4b71Sopenharmony_ci
154e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
155e41f4b71Sopenharmony_ci
156e41f4b71Sopenharmony_ci**Parameters** 
157e41f4b71Sopenharmony_ci
158e41f4b71Sopenharmony_ci| Name | Type                                       | Mandatory | Description                                                        |
159e41f4b71Sopenharmony_ci| ------ | ------------------------------------------- | ---- | ------------------------------------------------------------ |
160e41f4b71Sopenharmony_ci| value  | [CustomBuilder](ts-types.md#custombuilder8) | Yes  | Description.<br>**NOTE**<br>You need to customize the content – text or imagery recommended – in @Builder.<br>If the width and height of the custom content are in percentage, the reference range is a rectangle whose area is 44.4% x 25.4% of the ring diameter (28.6% x 28.6% for imagery), 0 vp away from the bottom of the ring, and centered horizontally.<br>If this parameter is set to null, no description is displayed.<br>If this parameter is not set, what's displayed is subject to the maximum and minimum value settings.<br>If either or both of the maximum and minimum values are set, they are displayed.<br>If neither maximum nor minimum values are set, no description is displayed.<br>The maximum and minimum values are displayed at the bottom of the ring and cannot be relocated. They may be blocked by the ring if the ring's start and end angles are not set properly. |
161e41f4b71Sopenharmony_ci
162e41f4b71Sopenharmony_ci### trackShadow<sup>11+</sup>
163e41f4b71Sopenharmony_ci
164e41f4b71Sopenharmony_citrackShadow(value: GaugeShadowOptions)
165e41f4b71Sopenharmony_ci
166e41f4b71Sopenharmony_ciSets the shadow style of the gauge.
167e41f4b71Sopenharmony_ci
168e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
169e41f4b71Sopenharmony_ci
170e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
171e41f4b71Sopenharmony_ci
172e41f4b71Sopenharmony_ci**Parameters** 
173e41f4b71Sopenharmony_ci
174e41f4b71Sopenharmony_ci| Name | Type                                               | Mandatory | Description                                                        |
175e41f4b71Sopenharmony_ci| ------ | --------------------------------------------------- | ---- | ------------------------------------------------------------ |
176e41f4b71Sopenharmony_ci| value  | [GaugeShadowOptions](#gaugeshadowoptions11)  | Yes  | Shadow style.<br>**NOTE**<br>The shadow color is the same as the ring color.<br>If this attribute is set to **null**, the shadow effect is disabled. |
177e41f4b71Sopenharmony_ci
178e41f4b71Sopenharmony_ci### indicator<sup>11+</sup>
179e41f4b71Sopenharmony_ci
180e41f4b71Sopenharmony_ciindicator(value: GaugeIndicatorOptions)
181e41f4b71Sopenharmony_ci
182e41f4b71Sopenharmony_ciSets the indicator style of the gauge.
183e41f4b71Sopenharmony_ci
184e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
185e41f4b71Sopenharmony_ci
186e41f4b71Sopenharmony_ci**Parameters** 
187e41f4b71Sopenharmony_ci
188e41f4b71Sopenharmony_ci| Name | Type                                                     | Mandatory | Description                                                 |
189e41f4b71Sopenharmony_ci| ------ | --------------------------------------------------------- | ---- | ----------------------------------------------------- |
190e41f4b71Sopenharmony_ci| value  | [GaugeIndicatorOptions](#gaugeindicatoroptions11)  | Yes  | Indicator style.<br>**NOTE**<br>If this attribute is set to **null**, no indicator is displayed. |
191e41f4b71Sopenharmony_ci
192e41f4b71Sopenharmony_ci### privacySensitive<sup>12+</sup>
193e41f4b71Sopenharmony_ci
194e41f4b71Sopenharmony_ciprivacySensitive(isPrivacySensitiveMode: Optional\<boolean\>)
195e41f4b71Sopenharmony_ci
196e41f4b71Sopenharmony_ciSets whether to enable privacy mode.
197e41f4b71Sopenharmony_ci
198e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
199e41f4b71Sopenharmony_ci
200e41f4b71Sopenharmony_ci**Parameters** 
201e41f4b71Sopenharmony_ci
202e41f4b71Sopenharmony_ci| Name | Type                                                     | Mandatory | Description                                                 |
203e41f4b71Sopenharmony_ci| ------ | --------------------------------------------------------- | ---- | ----------------------------------------------------- |
204e41f4b71Sopenharmony_ci| isPrivacySensitiveMode  | [Optional\<boolean\>] | Yes  | Whether to enable privacy mode. In privacy mode, the gauge indicator points to **0**, the maximum and minimum values are masked, and the scale range is displayed in gray or the background color.<br>**NOTE**<br>If this parameter is set to **null**, privacy mode is disabled.<br>[Enabling privacy mode requires widget framework support.](./ts-universal-attributes-obscured.md) |
205e41f4b71Sopenharmony_ci
206e41f4b71Sopenharmony_ci### contentModifier<sup>12+</sup>
207e41f4b71Sopenharmony_ci
208e41f4b71Sopenharmony_cicontentModifier(modifier: ContentModifier\<GaugeConfiguration>)
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_ciCreates a content modifier.
211e41f4b71Sopenharmony_ci
212e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
213e41f4b71Sopenharmony_ci
214e41f4b71Sopenharmony_ci**Parameters**
215e41f4b71Sopenharmony_ci
216e41f4b71Sopenharmony_ci| Name | Type                                         | Mandatory | Description                                            |
217e41f4b71Sopenharmony_ci| ------ | --------------------------------------------- | ---- | ------------------------------------------------ |
218e41f4b71Sopenharmony_ci| modifier  | [ContentModifier\<GaugeConfiguration>](#gaugeconfiguration12) | Yes  | Content modifier to apply to the current component.<br>**modifier**: content modifier. You need a custom class to implement the **ContentModifier** API. |
219e41f4b71Sopenharmony_ci
220e41f4b71Sopenharmony_ci## GaugeShadowOptions<sup>11+</sup>
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ciInherits from [MultiShadowOptions](ts-types.md#multishadowoptions10) and has all attributes of **MultiShadowOptions**.
223e41f4b71Sopenharmony_ci
224e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
225e41f4b71Sopenharmony_ci
226e41f4b71Sopenharmony_ci## GaugeIndicatorOptions<sup>11+</sup>
227e41f4b71Sopenharmony_ci
228e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12.
229e41f4b71Sopenharmony_ci
230e41f4b71Sopenharmony_ci| Name         | Type | Mandatory | Description |
231e41f4b71Sopenharmony_ci| ------------- | ------- | ---- | -------- |
232e41f4b71Sopenharmony_ci| icon | [Resource](ts-types.md#resource) | No | Image path of the icon.<br>**NOTE**<br>If this parameter is not set, the default triangle style indicator is used.<br>Icons in SVG format are supported. If icons in other formats are used, the default triangle style indicator is used. |
233e41f4b71Sopenharmony_ci| space | [Dimension](ts-types.md#dimension10) | No | Distance between the indicator and the outer edge of the ring. The value cannot be in percentage.<br>Default value: **8**<br>Unit: vp<br>**NOTE**<br> For the default triangle style indicator, the distance is the amount of space between the triangle and the outer edge of the ring.<br> If this parameter is set to a value less than 0, the default value will be used.<br>If this parameter is set to a value greater than the ring radius, the default value will be used.|
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ci## GaugeConfiguration<sup>12+</sup>
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ciYou need a custom class to implement the **ContentModifier** API.
238e41f4b71Sopenharmony_ci
239e41f4b71Sopenharmony_ci| Name | Type   | Description             |
240e41f4b71Sopenharmony_ci| ------ | ------ | ---------------- |
241e41f4b71Sopenharmony_ci| value | number | Current value. |
242e41f4b71Sopenharmony_ci| min | number | Minimum value of the current data segment. |
243e41f4b71Sopenharmony_ci| max | number | Maximum value of the current data segment. |
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ci
246e41f4b71Sopenharmony_ci## Example
247e41f4b71Sopenharmony_ci### Example 1
248e41f4b71Sopenharmony_ciThis example sets the current value, description, and auxiliary text.
249e41f4b71Sopenharmony_ci```ts
250e41f4b71Sopenharmony_ci@Entry
251e41f4b71Sopenharmony_ci@Component
252e41f4b71Sopenharmony_cistruct Gauge1 {
253e41f4b71Sopenharmony_ci  @Builder descriptionBuilder() {
254e41f4b71Sopenharmony_ci    Text('Description')
255e41f4b71Sopenharmony_ci      .maxFontSize('30sp')
256e41f4b71Sopenharmony_ci      .minFontSize("10.0vp")
257e41f4b71Sopenharmony_ci      .fontColor("#fffa2a2d")
258e41f4b71Sopenharmony_ci      .fontWeight(FontWeight.Medium)
259e41f4b71Sopenharmony_ci      .width('100%')
260e41f4b71Sopenharmony_ci      .height("100%")
261e41f4b71Sopenharmony_ci      .textAlign(TextAlign.Center)
262e41f4b71Sopenharmony_ci  }
263e41f4b71Sopenharmony_ci
264e41f4b71Sopenharmony_ci  build() {
265e41f4b71Sopenharmony_ci    Column() {
266e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
267e41f4b71Sopenharmony_ci        Column() {
268e41f4b71Sopenharmony_ci          Text('50')
269e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
270e41f4b71Sopenharmony_ci            .width('62%')
271e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
272e41f4b71Sopenharmony_ci            .maxFontSize("60.0vp")
273e41f4b71Sopenharmony_ci            .minFontSize("30.0vp")
274e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
275e41f4b71Sopenharmony_ci            .margin({ top: '35%' })
276e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
277e41f4b71Sopenharmony_ci            .maxLines(1)
278e41f4b71Sopenharmony_ci          Text('Auxiliary text')
279e41f4b71Sopenharmony_ci            .maxFontSize("16.0fp")
280e41f4b71Sopenharmony_ci            .minFontSize("10.0vp")
281e41f4b71Sopenharmony_ci            .fontColor($r('sys.color.ohos_id_color_text_secondary'))
282e41f4b71Sopenharmony_ci            .fontColor($r('sys.color.ohos_id_color_text_secondary'))
283e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Regular)
284e41f4b71Sopenharmony_ci            .width('67.4%')
285e41f4b71Sopenharmony_ci            .height('9.5%')
286e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
287e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
288e41f4b71Sopenharmony_ci      }
289e41f4b71Sopenharmony_ci      .value(50)
290e41f4b71Sopenharmony_ci      .startAngle(210)
291e41f4b71Sopenharmony_ci      .endAngle(150)
292e41f4b71Sopenharmony_ci      .colors([[new LinearGradient([{ color: "#deb6fb", offset: 0 }, { color: "#ac49f5", offset: 1 }]), 9],
293e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#bbb7fc", offset: 0 }, { color: "#564af7", offset: 1 }]), 8],
294e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#f5b5c2", offset: 0 }, { color: "#e64566", offset: 1 }]), 7],
295e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#f8c5a6", offset: 0 }, { color: "#ed6f21", offset: 1 }]), 6],
296e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#fceb99", offset: 0 }, { color: "#f7ce00", offset: 1 }]), 5],
297e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#dbefa5", offset: 0 }, { color: "#a5d61d", offset: 1 }]), 4],
298e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#c1e4be", offset: 0 }, { color: "#64bb5c", offset: 1 }]), 3],
299e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#c0ece5", offset: 0 }, { color: "#61cfbe", offset: 1 }]), 2],
300e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#b5e0f4", offset: 0 }, { color: "#46b1e3", offset: 1 }]), 1]])
301e41f4b71Sopenharmony_ci      .width('80%')
302e41f4b71Sopenharmony_ci      .height('80%')
303e41f4b71Sopenharmony_ci      .strokeWidth(18)
304e41f4b71Sopenharmony_ci      .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
305e41f4b71Sopenharmony_ci      .description(this.descriptionBuilder)
306e41f4b71Sopenharmony_ci      .padding(18)
307e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
308e41f4b71Sopenharmony_ci  }
309e41f4b71Sopenharmony_ci}
310e41f4b71Sopenharmony_ci```
311e41f4b71Sopenharmony_ci![gauge](figures/gauge-image1.png)
312e41f4b71Sopenharmony_ci
313e41f4b71Sopenharmony_ci### Example 2
314e41f4b71Sopenharmony_ciThis example sets the current value and icon.
315e41f4b71Sopenharmony_ci```ts
316e41f4b71Sopenharmony_ci@Entry
317e41f4b71Sopenharmony_ci@Component
318e41f4b71Sopenharmony_cistruct Gauge2 {
319e41f4b71Sopenharmony_ci  @Builder descriptionBuilderImage() {
320e41f4b71Sopenharmony_ci    Image($r('sys.media.ohos_ic_public_clock')).width(72).height(72)
321e41f4b71Sopenharmony_ci  }
322e41f4b71Sopenharmony_ci
323e41f4b71Sopenharmony_ci  build() {
324e41f4b71Sopenharmony_ci    Column() {
325e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
326e41f4b71Sopenharmony_ci        Column() {
327e41f4b71Sopenharmony_ci          Text('50')
328e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
329e41f4b71Sopenharmony_ci            .width('62%')
330e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
331e41f4b71Sopenharmony_ci            .maxFontSize("60.0vp")
332e41f4b71Sopenharmony_ci            .minFontSize("30.0vp")
333e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
334e41f4b71Sopenharmony_ci            .margin({ top: '35%' })
335e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
336e41f4b71Sopenharmony_ci            .maxLines(1)
337e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
338e41f4b71Sopenharmony_ci      }
339e41f4b71Sopenharmony_ci      .startAngle(210)
340e41f4b71Sopenharmony_ci      .endAngle(150)
341e41f4b71Sopenharmony_ci      .colors('#cca5d61d')
342e41f4b71Sopenharmony_ci      .width('80%')
343e41f4b71Sopenharmony_ci      .height('80%')
344e41f4b71Sopenharmony_ci      .strokeWidth(18)
345e41f4b71Sopenharmony_ci      .description(this.descriptionBuilderImage)
346e41f4b71Sopenharmony_ci      .padding(18)
347e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
348e41f4b71Sopenharmony_ci  }
349e41f4b71Sopenharmony_ci}
350e41f4b71Sopenharmony_ci```
351e41f4b71Sopenharmony_ci![gauge](figures/gauge-image2.png)
352e41f4b71Sopenharmony_ci
353e41f4b71Sopenharmony_ci### Example 3
354e41f4b71Sopenharmony_ciThis example sets the current value and description.
355e41f4b71Sopenharmony_ci```ts
356e41f4b71Sopenharmony_ci@Entry
357e41f4b71Sopenharmony_ci@Component
358e41f4b71Sopenharmony_cistruct Gauge3 {
359e41f4b71Sopenharmony_ci  @Builder descriptionBuilder() {
360e41f4b71Sopenharmony_ci    Text('Description')
361e41f4b71Sopenharmony_ci      .maxFontSize('30sp')
362e41f4b71Sopenharmony_ci      .minFontSize("10.0vp")
363e41f4b71Sopenharmony_ci      .fontColor("#fffa2a2d")
364e41f4b71Sopenharmony_ci      .fontWeight(FontWeight.Medium)
365e41f4b71Sopenharmony_ci      .width('100%')
366e41f4b71Sopenharmony_ci      .height("100%")
367e41f4b71Sopenharmony_ci      .textAlign(TextAlign.Center)
368e41f4b71Sopenharmony_ci  }
369e41f4b71Sopenharmony_ci
370e41f4b71Sopenharmony_ci  build() {
371e41f4b71Sopenharmony_ci    Column() {
372e41f4b71Sopenharmony_ci      Column() {
373e41f4b71Sopenharmony_ci        Gauge({ value: 50, min: 1, max: 100 }) {
374e41f4b71Sopenharmony_ci          Column() {
375e41f4b71Sopenharmony_ci            Text('50')
376e41f4b71Sopenharmony_ci              .fontWeight(FontWeight.Medium)
377e41f4b71Sopenharmony_ci              .width('62%')
378e41f4b71Sopenharmony_ci              .fontColor("#ff182431")
379e41f4b71Sopenharmony_ci              .maxFontSize("60.0vp")
380e41f4b71Sopenharmony_ci              .minFontSize("30.0vp")
381e41f4b71Sopenharmony_ci              .textAlign(TextAlign.Center)
382e41f4b71Sopenharmony_ci              .margin({ top: '35%' })
383e41f4b71Sopenharmony_ci              .textOverflow({ overflow: TextOverflow.Ellipsis })
384e41f4b71Sopenharmony_ci              .maxLines(1)
385e41f4b71Sopenharmony_ci          }.width('100%').height('100%')
386e41f4b71Sopenharmony_ci        }
387e41f4b71Sopenharmony_ci        .startAngle(210)
388e41f4b71Sopenharmony_ci        .endAngle(150)
389e41f4b71Sopenharmony_ci        .colors([[new LinearGradient([{ color: "#deb6fb", offset: 0 }, { color: "#ac49f5", offset: 1 }]), 9],
390e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#bbb7fc", offset: 0 }, { color: "#564af7", offset: 1 }]), 8],
391e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#f5b5c2", offset: 0 }, { color: "#e64566", offset: 1 }]), 7],
392e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#f8c5a6", offset: 0 }, { color: "#ed6f21", offset: 1 }]), 6],
393e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#fceb99", offset: 0 }, { color: "#f7ce00", offset: 1 }]), 5],
394e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#dbefa5", offset: 0 }, { color: "#a5d61d", offset: 1 }]), 4],
395e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#c1e4be", offset: 0 }, { color: "#64bb5c", offset: 1 }]), 3],
396e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#c0ece5", offset: 0 }, { color: "#61cfbe", offset: 1 }]), 2],
397e41f4b71Sopenharmony_ci          [new LinearGradient([{ color: "#b5e0f4", offset: 0 }, { color: "#46b1e3", offset: 1 }]), 1]])
398e41f4b71Sopenharmony_ci        .width('80%')
399e41f4b71Sopenharmony_ci        .height('80%')
400e41f4b71Sopenharmony_ci        .strokeWidth(18)
401e41f4b71Sopenharmony_ci        .description(this.descriptionBuilder)
402e41f4b71Sopenharmony_ci        .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
403e41f4b71Sopenharmony_ci        .padding(18)
404e41f4b71Sopenharmony_ci      }.margin({ top: 40 }).width('100%').height('100%')
405e41f4b71Sopenharmony_ci    }
406e41f4b71Sopenharmony_ci  }
407e41f4b71Sopenharmony_ci}
408e41f4b71Sopenharmony_ci```
409e41f4b71Sopenharmony_ci![gauge](figures/gauge-image3.png)
410e41f4b71Sopenharmony_ci
411e41f4b71Sopenharmony_ci### Example 4
412e41f4b71Sopenharmony_ciThis example sets the current value and auxiliary text.
413e41f4b71Sopenharmony_ci```ts
414e41f4b71Sopenharmony_ci@Entry
415e41f4b71Sopenharmony_ci@Component
416e41f4b71Sopenharmony_cistruct Gauge4 {
417e41f4b71Sopenharmony_ci  build() {
418e41f4b71Sopenharmony_ci    Column() {
419e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
420e41f4b71Sopenharmony_ci        Column() {
421e41f4b71Sopenharmony_ci          Text('50')
422e41f4b71Sopenharmony_ci            .maxFontSize("72.0vp")
423e41f4b71Sopenharmony_ci            .minFontSize("10.0vp")
424e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
425e41f4b71Sopenharmony_ci            .width('40%')
426e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
427e41f4b71Sopenharmony_ci            .margin({ top: '35%' })
428e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
429e41f4b71Sopenharmony_ci            .maxLines(1)
430e41f4b71Sopenharmony_ci          Text('Auxiliary text')
431e41f4b71Sopenharmony_ci            .maxFontSize("30.0vp")
432e41f4b71Sopenharmony_ci            .minFontSize("18.0vp")
433e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
434e41f4b71Sopenharmony_ci            .fontColor($r('sys.color.ohos_id_color_text_secondary'))
435e41f4b71Sopenharmony_ci            .width('62%')
436e41f4b71Sopenharmony_ci            .height('15.9%')
437e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
438e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
439e41f4b71Sopenharmony_ci      }
440e41f4b71Sopenharmony_ci      .startAngle(210)
441e41f4b71Sopenharmony_ci      .endAngle(150)
442e41f4b71Sopenharmony_ci      .colors([[new LinearGradient([{ color: "#deb6fb", offset: 0 }, { color: "#ac49f5", offset: 1 }]), 9],
443e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#bbb7fc", offset: 0 }, { color: "#564af7", offset: 1 }]), 8],
444e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#f5b5c2", offset: 0 }, { color: "#e64566", offset: 1 }]), 7],
445e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#f8c5a6", offset: 0 }, { color: "#ed6f21", offset: 1 }]), 6],
446e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#fceb99", offset: 0 }, { color: "#f7ce00", offset: 1 }]), 5],
447e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#dbefa5", offset: 0 }, { color: "#a5d61d", offset: 1 }]), 4],
448e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#c1e4be", offset: 0 }, { color: "#64bb5c", offset: 1 }]), 3],
449e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#c0ece5", offset: 0 }, { color: "#61cfbe", offset: 1 }]), 2],
450e41f4b71Sopenharmony_ci        [new LinearGradient([{ color: "#b5e0f4", offset: 0 }, { color: "#46b1e3", offset: 1 }]), 1]])
451e41f4b71Sopenharmony_ci      .width('80%')
452e41f4b71Sopenharmony_ci      .height('80%')
453e41f4b71Sopenharmony_ci      .strokeWidth(18)
454e41f4b71Sopenharmony_ci      .description(null)
455e41f4b71Sopenharmony_ci      .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
456e41f4b71Sopenharmony_ci      .padding(18)
457e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
458e41f4b71Sopenharmony_ci  }
459e41f4b71Sopenharmony_ci}
460e41f4b71Sopenharmony_ci```
461e41f4b71Sopenharmony_ci![gauge](figures/gauge-image4.png)
462e41f4b71Sopenharmony_ci
463e41f4b71Sopenharmony_ci### Example 5
464e41f4b71Sopenharmony_ciThis example sets the current value, maximum value, and minimum value.
465e41f4b71Sopenharmony_ci```ts
466e41f4b71Sopenharmony_ci@Entry
467e41f4b71Sopenharmony_ci@Component
468e41f4b71Sopenharmony_cistruct Gauge5 {
469e41f4b71Sopenharmony_ci  build() {
470e41f4b71Sopenharmony_ci    Column() {
471e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
472e41f4b71Sopenharmony_ci        Column() {
473e41f4b71Sopenharmony_ci          Text('50')
474e41f4b71Sopenharmony_ci            .maxFontSize("80sp")
475e41f4b71Sopenharmony_ci            .minFontSize("60.0vp")
476e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
477e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
478e41f4b71Sopenharmony_ci            .width('40%')
479e41f4b71Sopenharmony_ci            .height('30%')
480e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
481e41f4b71Sopenharmony_ci            .margin({ top: '22.2%' })
482e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
483e41f4b71Sopenharmony_ci            .maxLines(1)
484e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
485e41f4b71Sopenharmony_ci      }
486e41f4b71Sopenharmony_ci      .startAngle(225)
487e41f4b71Sopenharmony_ci      .endAngle(135)
488e41f4b71Sopenharmony_ci      .colors(new LinearGradient([{ color: "#e84026", offset: 0 },
489e41f4b71Sopenharmony_ci        { color: "#f7ce00", offset: 0.6 },
490e41f4b71Sopenharmony_ci        { color: "#64bb5c", offset: 1 }]))
491e41f4b71Sopenharmony_ci      .width('80%')
492e41f4b71Sopenharmony_ci      .height('80%')
493e41f4b71Sopenharmony_ci      .strokeWidth(18)
494e41f4b71Sopenharmony_ci      .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
495e41f4b71Sopenharmony_ci      .padding(18)
496e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
497e41f4b71Sopenharmony_ci  }
498e41f4b71Sopenharmony_ci}
499e41f4b71Sopenharmony_ci```
500e41f4b71Sopenharmony_ci![gauge](figures/gauge-image5.png)
501e41f4b71Sopenharmony_ci
502e41f4b71Sopenharmony_ci### Example 6
503e41f4b71Sopenharmony_ciThis example sets the current value, maximum and minimum values, and auxiliary text.
504e41f4b71Sopenharmony_ci```ts
505e41f4b71Sopenharmony_ci@Entry
506e41f4b71Sopenharmony_ci@Component
507e41f4b71Sopenharmony_cistruct Gauge6 {
508e41f4b71Sopenharmony_ci  build() {
509e41f4b71Sopenharmony_ci    Column() {
510e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
511e41f4b71Sopenharmony_ci        Column() {
512e41f4b71Sopenharmony_ci          Text('50')
513e41f4b71Sopenharmony_ci            .maxFontSize('60sp')
514e41f4b71Sopenharmony_ci            .minFontSize('30.0vp')
515e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
516e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
517e41f4b71Sopenharmony_ci            .width('62%')
518e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
519e41f4b71Sopenharmony_ci            .margin({ top: '35%' })
520e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
521e41f4b71Sopenharmony_ci            .maxLines(1)
522e41f4b71Sopenharmony_ci          Text('Auxiliary text')
523e41f4b71Sopenharmony_ci            .maxFontSize('16sp')
524e41f4b71Sopenharmony_ci            .minFontSize("10.0vp")
525e41f4b71Sopenharmony_ci            .fontColor($r('sys.color.ohos_id_color_text_secondary'))
526e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Regular)
527e41f4b71Sopenharmony_ci            .width('67.4%')
528e41f4b71Sopenharmony_ci            .height('9.5%')
529e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
530e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
531e41f4b71Sopenharmony_ci      }
532e41f4b71Sopenharmony_ci      .startAngle(225)
533e41f4b71Sopenharmony_ci      .endAngle(135)
534e41f4b71Sopenharmony_ci      .colors(Color.Red)
535e41f4b71Sopenharmony_ci      .width('80%')
536e41f4b71Sopenharmony_ci      .height('80%')
537e41f4b71Sopenharmony_ci      .indicator(null)
538e41f4b71Sopenharmony_ci      .strokeWidth(18)
539e41f4b71Sopenharmony_ci      .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
540e41f4b71Sopenharmony_ci      .padding(18)
541e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
542e41f4b71Sopenharmony_ci  }
543e41f4b71Sopenharmony_ci}
544e41f4b71Sopenharmony_ci```
545e41f4b71Sopenharmony_ci![gauge](figures/gauge-image6.png)
546e41f4b71Sopenharmony_ci
547e41f4b71Sopenharmony_ci### Example 7
548e41f4b71Sopenharmony_ciThis example sets the current value, maximum value, and minimum value.
549e41f4b71Sopenharmony_ci```ts
550e41f4b71Sopenharmony_ci@Entry
551e41f4b71Sopenharmony_ci@Component
552e41f4b71Sopenharmony_cistruct Gauge7 {
553e41f4b71Sopenharmony_ci  build() {
554e41f4b71Sopenharmony_ci    Column() {
555e41f4b71Sopenharmony_ci      Gauge({ value: 50, min: 1, max: 100 }) {
556e41f4b71Sopenharmony_ci        Column() {
557e41f4b71Sopenharmony_ci          Text('50')
558e41f4b71Sopenharmony_ci            .maxFontSize('60sp')
559e41f4b71Sopenharmony_ci            .minFontSize('30.0vp')
560e41f4b71Sopenharmony_ci            .fontWeight(FontWeight.Medium)
561e41f4b71Sopenharmony_ci            .fontColor("#ff182431")
562e41f4b71Sopenharmony_ci            .width('62%')
563e41f4b71Sopenharmony_ci            .textAlign(TextAlign.Center)
564e41f4b71Sopenharmony_ci            .margin({ top: '35%' })
565e41f4b71Sopenharmony_ci            .textOverflow({ overflow: TextOverflow.Ellipsis })
566e41f4b71Sopenharmony_ci            .maxLines(1)
567e41f4b71Sopenharmony_ci        }.width('100%').height('100%')
568e41f4b71Sopenharmony_ci      }
569e41f4b71Sopenharmony_ci      .startAngle(225)
570e41f4b71Sopenharmony_ci      .endAngle(135)
571e41f4b71Sopenharmony_ci      .colors(Color.Red)
572e41f4b71Sopenharmony_ci      .width('80%')
573e41f4b71Sopenharmony_ci      .height('80%')
574e41f4b71Sopenharmony_ci      .indicator(null)
575e41f4b71Sopenharmony_ci      .strokeWidth(18)
576e41f4b71Sopenharmony_ci      .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
577e41f4b71Sopenharmony_ci      .padding(18)
578e41f4b71Sopenharmony_ci    }.margin({ top: 40 }).width('100%').height('100%')
579e41f4b71Sopenharmony_ci  }
580e41f4b71Sopenharmony_ci}
581e41f4b71Sopenharmony_ci```
582e41f4b71Sopenharmony_ci![gauge](figures/gauge-image7.png)
583e41f4b71Sopenharmony_ci
584e41f4b71Sopenharmony_ci
585e41f4b71Sopenharmony_ci
586e41f4b71Sopenharmony_ci### Example 8
587e41f4b71Sopenharmony_ci
588e41f4b71Sopenharmony_ci```ts
589e41f4b71Sopenharmony_ci// xxx.ets
590e41f4b71Sopenharmony_ci// The example implements the customization of the gauge's content area using a Builder, utilizing a circular chart, buttons, and text boxes. When the increase button is clicked, the indicator will shift to the right; conversely, when the decrease button is clicked, the indicator will shift to the left.
591e41f4b71Sopenharmony_ci@Builder
592e41f4b71Sopenharmony_cifunction buildGauge(config: GaugeConfiguration) {
593e41f4b71Sopenharmony_ci  Column({ space: 30 }) {
594e41f4b71Sopenharmony_ci    Row() {
595e41f4b71Sopenharmony_ci      Text('[ContentModifier] value: ' + JSON.stringify((config.contentModifier as MyGaugeStyle).value) +
596e41f4b71Sopenharmony_ci        ' min:' + JSON.stringify((config.contentModifier as MyGaugeStyle).min) +
597e41f4b71Sopenharmony_ci        ' max:' + JSON.stringify((config.contentModifier as MyGaugeStyle).max))
598e41f4b71Sopenharmony_ci        .fontSize(12)
599e41f4b71Sopenharmony_ci    }
600e41f4b71Sopenharmony_ci
601e41f4b71Sopenharmony_ci    Text('[Config] value: ' + config.value + ' min: ' + config.min + ' max: ' + config.max).fontSize(12)
602e41f4b71Sopenharmony_ci    Gauge({
603e41f4b71Sopenharmony_ci      value: config.value,
604e41f4b71Sopenharmony_ci      min: config.min,
605e41f4b71Sopenharmony_ci      max: config.max
606e41f4b71Sopenharmony_ci    }).width("50%")
607e41f4b71Sopenharmony_ci  }
608e41f4b71Sopenharmony_ci  .width("100%")
609e41f4b71Sopenharmony_ci  .padding(20)
610e41f4b71Sopenharmony_ci  .margin({ top: 5 })
611e41f4b71Sopenharmony_ci  .alignItems(HorizontalAlign.Center)
612e41f4b71Sopenharmony_ci}
613e41f4b71Sopenharmony_ci
614e41f4b71Sopenharmony_ciclass MyGaugeStyle implements ContentModifier<GaugeConfiguration> {
615e41f4b71Sopenharmony_ci  value: number = 0
616e41f4b71Sopenharmony_ci  min: number = 0
617e41f4b71Sopenharmony_ci  max: number = 0
618e41f4b71Sopenharmony_ci
619e41f4b71Sopenharmony_ci  constructor(value: number, min: number, max: number) {
620e41f4b71Sopenharmony_ci    this.value = value
621e41f4b71Sopenharmony_ci    this.min = min
622e41f4b71Sopenharmony_ci    this.max = max
623e41f4b71Sopenharmony_ci  }
624e41f4b71Sopenharmony_ci
625e41f4b71Sopenharmony_ci  applyContent(): WrappedBuilder<[GaugeConfiguration]> {
626e41f4b71Sopenharmony_ci    return wrapBuilder(buildGauge)
627e41f4b71Sopenharmony_ci  }
628e41f4b71Sopenharmony_ci}
629e41f4b71Sopenharmony_ci
630e41f4b71Sopenharmony_ci@Entry
631e41f4b71Sopenharmony_ci@Component
632e41f4b71Sopenharmony_cistruct refreshExample {
633e41f4b71Sopenharmony_ci  @State gaugeValue: number = 20
634e41f4b71Sopenharmony_ci  @State gaugeMin: number = 0
635e41f4b71Sopenharmony_ci  @State gaugeMax: number = 100
636e41f4b71Sopenharmony_ci
637e41f4b71Sopenharmony_ci  build() {
638e41f4b71Sopenharmony_ci    Column({ space: 20 }) {
639e41f4b71Sopenharmony_ci      Gauge({
640e41f4b71Sopenharmony_ci        value: this.gaugeValue,
641e41f4b71Sopenharmony_ci        min: this.gaugeMin,
642e41f4b71Sopenharmony_ci        max: this.gaugeMax
643e41f4b71Sopenharmony_ci      })
644e41f4b71Sopenharmony_ci        .contentModifier(new MyGaugeStyle(30, 10, 100))
645e41f4b71Sopenharmony_ci
646e41f4b71Sopenharmony_ci      Column({ space: 20 }) {
647e41f4b71Sopenharmony_ci        Row({ space: 20 }) {
648e41f4b71Sopenharmony_ci          Button ('Increase').onClick () => {
649e41f4b71Sopenharmony_ci            if (this.gaugeValue < this.gaugeMax) {
650e41f4b71Sopenharmony_ci              this.gaugeValue += 1
651e41f4b71Sopenharmony_ci            }
652e41f4b71Sopenharmony_ci          })
653e41f4b71Sopenharmony_ci          Button ('Decrease').onClick () => {
654e41f4b71Sopenharmony_ci            if (this.gaugeValue > this.gaugeMin) {
655e41f4b71Sopenharmony_ci              this.gaugeValue -= 1
656e41f4b71Sopenharmony_ci            }
657e41f4b71Sopenharmony_ci          })
658e41f4b71Sopenharmony_ci        }
659e41f4b71Sopenharmony_ci      }.width('100%')
660e41f4b71Sopenharmony_ci    }.width('100%').margin({ top: 5 })
661e41f4b71Sopenharmony_ci  }
662e41f4b71Sopenharmony_ci}
663e41f4b71Sopenharmony_ci```
664e41f4b71Sopenharmony_ci![gauge](figures/gauge_builder.gif)
665e41f4b71Sopenharmony_ci
666e41f4b71Sopenharmony_ci
667e41f4b71Sopenharmony_ci### Example 9
668e41f4b71Sopenharmony_ci
669e41f4b71Sopenharmony_ciThis example shows how to enable privacy mode, which requires widget framework support.
670e41f4b71Sopenharmony_ci
671e41f4b71Sopenharmony_ci```ts
672e41f4b71Sopenharmony_ci@Entry
673e41f4b71Sopenharmony_ci@Component
674e41f4b71Sopenharmony_cistruct GaugeExample {
675e41f4b71Sopenharmony_ci  build() {
676e41f4b71Sopenharmony_ci    Scroll() {
677e41f4b71Sopenharmony_ci      Column({ space: 15 }) {
678e41f4b71Sopenharmony_ci        Row() {
679e41f4b71Sopenharmony_ci          Gauge({ value: 50, min: 1, max: 100 }) {
680e41f4b71Sopenharmony_ci            Column() {
681e41f4b71Sopenharmony_ci              Text('60')
682e41f4b71Sopenharmony_ci                .maxFontSize("180sp")
683e41f4b71Sopenharmony_ci                .minFontSize("160.0vp")
684e41f4b71Sopenharmony_ci                .fontWeight(FontWeight.Medium)
685e41f4b71Sopenharmony_ci                .fontColor("#ff182431")
686e41f4b71Sopenharmony_ci                .width('40%')
687e41f4b71Sopenharmony_ci                .height('30%')
688e41f4b71Sopenharmony_ci                .textAlign(TextAlign.Center)
689e41f4b71Sopenharmony_ci                .margin({ top: '22.2%' })
690e41f4b71Sopenharmony_ci                .textOverflow({ overflow: TextOverflow.Ellipsis })
691e41f4b71Sopenharmony_ci                .maxLines(1)
692e41f4b71Sopenharmony_ci            }.width('100%').height('100%')
693e41f4b71Sopenharmony_ci          }
694e41f4b71Sopenharmony_ci          .startAngle(225)
695e41f4b71Sopenharmony_ci          .endAngle(135)
696e41f4b71Sopenharmony_ci          .colors(Color.Red)
697e41f4b71Sopenharmony_ci          .width('80%')
698e41f4b71Sopenharmony_ci          .height('80%')
699e41f4b71Sopenharmony_ci          .strokeWidth(18)
700e41f4b71Sopenharmony_ci          .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 })
701e41f4b71Sopenharmony_ci          .padding(18)
702e41f4b71Sopenharmony_ci          .privacySensitive(true)
703e41f4b71Sopenharmony_ci        }
704e41f4b71Sopenharmony_ci      }
705e41f4b71Sopenharmony_ci    }
706e41f4b71Sopenharmony_ci  }
707e41f4b71Sopenharmony_ci}
708e41f4b71Sopenharmony_ci```
709e41f4b71Sopenharmony_ci![gauge](figures/gauge-privacysensitive.gif)
710