This is a migrated thread and some comments may be shown as answers.

Value label for linear gauge

7 Answers 351 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 11 Apr 2012, 04:15 PM
Hello everyone,

We implement linear gauges with the arrow pointer in our application.  I was wondering if there is a way to display an actual label next to the pointer, which would show the value?  Please see the attached image.

Also, had a question about scaling the size of the linear gauge.  It looks like the background of the gauge is an actual image.  If we would like to scale down the size of the entire gauge to adjust to the size of its outer container, what method would you recommend for that?

Thank you for your help.

7 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 16 Apr 2012, 01:35 PM
Hello Alex,

This feature is currently unsupported, and we might consider it for implementation if you log it on uservoice.

Until it gets implemented, you can show the current value of the gauge in a HTML element beside it, like so:

<div id="gauge1">
   <div class="gauge"></div>
   <div class="gauge-value">0</div>
</div>

<script>
function setGaugeValue(gaugeId, value) {
    $(gaugeId)
        .find(".gauge-value").text(value).end() 
        .find(".gauge").data("kendoGauge").value(value);
}
</script>
<style>
    .gauge, .gauge-value {
        display: inline-block;
        *display: inline; 
        zoom: 1;
        vertical-align: middle;
    }
</style>

Kind regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Alex Gyoshev
Telerik team
answered on 16 Apr 2012, 02:13 PM
Hello Alex,

I am sorry, for I didn't answer your second question. If I understand it right, you need a scalable container for the gauge? If so, it is advisable to use CSS3 gradients and shadows instead of an image, because they will fit any container you need.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Felipe
Top achievements
Rank 1
answered on 14 May 2012, 06:07 PM
Hello Alex:

Can you please give me an example on how to position the div with the custom value exactly on top of the selected value?

Just as my awezome picture shows (:P)

Thanks!
0
Alex Gyoshev
Telerik team
answered on 15 May 2012, 08:06 AM
Hello Felipe,

We don't have an API for that, but you may look at the source code of the chart and see how the Tooltip class is used -- albeit currently unsupported, this may lead you to a solution in your scenario.

You can also submit a feature request on uservoice so that we consider implementing the feature for a future release.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Felipe
Top achievements
Rank 1
answered on 15 May 2012, 08:10 AM
Thanks for your repply Alex, I will take a look at the code to see if I can get to something.

I tried to submit a new feature this afternoon (monday) and it was rejected, the page showed me a message saying I was unauthorized, what could I be doing wrong?
0
Alex Gyoshev
Telerik team
answered on 15 May 2012, 08:53 AM
Hello Felipe,

I assume that you need to be logged in to post an issue. Or it may be a temporary problem with the uservoice platform...?

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Felipe
Top achievements
Rank 1
answered on 15 May 2012, 03:47 PM
Hello Alex:

As far as I know I was logged in with my Google Account. I'll maybe try to submit it later!

Thanks for everything!
Tags
Gauges
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Felipe
Top achievements
Rank 1
Share this question
or