Skip to content

Commit

Permalink
docs(radialgauge): add kb for showing value
Browse files Browse the repository at this point in the history
  • Loading branch information
filipKovachev committed Apr 12, 2024
1 parent 0da5019 commit cc28148
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
4 changes: 4 additions & 0 deletions knowledge-base/examples/radial-gauge-value/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createApp } from 'vue'
import App from './main.vue'

createApp(App).mount('#app')
42 changes: 42 additions & 0 deletions knowledge-base/examples/radial-gauge-value/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="gauge-container">
<div class="gauge-wrapper">
<RadialGauge :pointer="pointer" />
</div>
<div class="gauge-value">{{ value }}</div>
</div>
</template>
<script>
import { RadialGauge } from '@progress/kendo-vue-gauges';
export default {
components: {
RadialGauge,
},
computed: {
pointer() {
return { value: this.value };
},
},
mounted() {
setInterval(() => {
this.value = Math.ceil(Math.random() * 100);
}, 1000);
},
data() {
return {
value: 30,
};
},
};
</script>
<style scoped>
.gauge-value {
position: relative;
left: 0;
right: 0;
top: -40px;
text-align: center;
}
</style>

39 changes: 39 additions & 0 deletions knowledge-base/radial-gauge-value.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Display Value for the RadialGauge
description: An example of how to display the value in the Kendo UI for Vue Native RadialGauge.
type: how-to
page_title: Display Value for the RadialGauge - Kendo UI for Vue RadialGauge
slug: radial-gauge-value
tags: radialgauge, gauge, value
res_type: kb
category: knowledge-base
---


## Environment

<table>
<tbody>
<tr>
<td>Product Version</td>
<td>3.3.13</td>
</tr>
<tr>
<td>Product</td>
<td>Progress® Kendo UI for Vue Native</td>
</tr>
</tbody>
</table>

## Description

How can I show the value of the RadialGauge in the center?

## Solution

This can be achieved by rendering a custom label element with the value inside that is relatively positioned:

{% meta id height:500 %}
{% embed_file radial-gauge-value/main.vue preview %}
{% embed_file radial-gauge-value/main.js %}
{% endmeta %}

0 comments on commit cc28148

Please sign in to comment.