You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+81-10Lines changed: 81 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ After you have initialized the component, use it everywhere you want in your app
69
69
lineMode="in 10"
70
70
:legend="true"
71
71
:legendValue="180"
72
+
:legendFormatter="({currentValue}) => new Intl.NumberFormat('de-DE').format(currentValue)"
72
73
legendClass="legend-custom-style"
73
74
dash="60 0.9"
74
75
animation="reverse 700 400"
@@ -111,6 +112,7 @@ This table below provides a quick overview over all available options. To gain m
111
112
|**[`emptyColorFill`](#emptycolorfill)**| String \| Object | same as `color`| "transparent" |
112
113
|**[`legend`](#legend)**| Boolean || true |
113
114
|**[`legendValue`](#legendvalue)**| Number \| String | any number, accepts a `.` or `","` as decimals delimiter ||
115
+
|**[`legendFormatter`](#legendformatter)**[](#legendformatter)| Function | Function that returns formatted value ||
this.myProgress=this.tasksDone*100/ maxTasks; // the percentage of done tasks
151
153
```
152
154
153
-
>:heavy_exclamation_mark: The `progress` is always used to fill the progress circle line. So you cannot customize this value, it should be always in the range [-100, 100] and not valid Numbers lead to **[`noData`](#noData)** state. For customization purpose please use **[`legendValue`](#legendvalue)**.
155
+
>:heavy_exclamation_mark: The `progress` is always used to fill the progress circle line. So you cannot customize this
156
+
>value, it should be always in the range [-100, 100] and not valid Numbers lead to **[`noData`](#noData)** state.
157
+
>For customization purpose please use **[`legendValue`](#legendvalue)** and take a look at **[`legendFormatter`](#legendformatter)**.
154
158
155
159
>If **[`legendValue`](#legendvalue)** is defined the progress will **NOT** be displayed as circle legend.
156
160
@@ -308,29 +312,75 @@ Is a Boolean. It defines whether the **[`progress`](#progress)** or from you def
308
312
309
313
###### Animated: :heavy_check_mark:
310
314
311
-
Is any number. Use this property if you want to customize the shown progress as the legend of the circle. If defined, `legendValue` will replace **[`progress`](#progress)** as the circle legend!
312
-
313
-
[](#legendvalue) You can set any precision of the decimal numbers. If the prop is defined as a string, you can specify the `","` as decimals separator (e.g "123,123" for german numbers).
315
+
Is any Number or String. Use this property if you want to show progress value as the legend of the circle that is not in
316
+
the range [-100, 100]. If defined, `legendValue` will replace [`progress`](#progress) as the circle legend!
317
+
You can set any precision of the decimal numbers. If the prop is defined as a string, you can specify the `","`
318
+
as decimals delimiter (e.g "123,123" for german numbers), apart from this the value must generally be a valid JavaScript Number.
319
+
For more customization possibilities please use [`legendFormatter`](#legendformatter) or [`scoped slot`](#default).
314
320
315
321
###### Example: :scroll:
316
322
317
-
Let's say you need to display a rating from 0 to 5 of a product with 3.5 stars. Since **[`progress`](#progress)** can take values only from 0 to 100 your need an additional property `legendValue`. You can show the product rating like in the following example:
323
+
Let's say you need to display a rating from 0 to 5 of a product with 3.5 stars. Setting the [`progress`](#progress) to 3.5 will
324
+
fill the circle to 3.5 percent, and this is not what we need, since we want to display the percentage of 5 as progress.
325
+
At this point we need an additional property `legendValue`. We can show the product rating like in the following example:
0 commit comments