Ticket T403196
Visible to All Users

Web Gauge Item - How to change label font and text

created 9 years ago

[DevExpress Support Team: CLONED FROM T374928: Web Gauge Item - How to change gauge background color]
This option worked well for me.  Thank you.

Very close to marking your comment as a solution, but I'm now trying to understand how I can change the font weight and font color for the Gauge value label that shows the current gauge value at the bottom.

Also, I am finding that you have to take the same types of actions (font weights, etc.) by manipulating the client side objects in different ways (which is confusing since I'm just dealing with different types of widgets) and that the documentation doesn't seem to elaborate on certain things.  For example, I cannot find any reference in the Dev Extreme documentation to what you have shown in your code example.  I also cannot find any references that show how to manipulate the font weight on the object.

I certainly don't mind try to dig in more here but it just seems that the documentation does not include all references that are needed.

Thanks for the help.

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

The dxCircularGauge widget API is described in the following help topic: Data Visualization Widgets dxCircularGauge.
However, I should note that some widget settings are implemented specially for the web dashboard viewer and are not described in the documentation. To customize the label, use the following code:

JavaScript
if (e.ItemName.indexOf('gauge') >= 0) { var gauges = e.GetWidget(); $.each(gauges, function (_, gauge) { gauge.option('indicator.text.value', 'Test'); gauge.option('indicator.text.font', { family: 'Zapf-Chancery, cursive', weight: 400, color: 'forestgreen', size: 22 }); }); }

I have attached a sample project to my reply demonstrating this solution. Note that there is no way to change the font color using this code. I have registered a separate report regarding this limitation: T403377: Web Gauge Item - It is impossible to change a label color. We will research the issue and check if any alternative solution is available.

    Comments (2)

      thanks…

      1- and about font size for point labels around gauge?
      2 - and value label in center?

      DevExpress Support Team 8 years ago

        Use the scale > label > font property to set labels' font:

        JavaScript
        gauge.option('scale.label.font', { family: 'Zapf-Chancery, cursive', weight: 400, color: 'Red', size: 22 });

        I am afraid it is impossible to change the position of the value indicator.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.