Ticket T374928
Visible to All Users

Web Gauge Item - How to change gauge background color

created 9 years ago

[DevExpress Support Team: CLONED FROM T373917: Gauge Item - Change background color]
Constant, and for web!
I know that to be here:
dash1.ClientSideEvents.ItemWidgetCreated = ("function(s, e) { ItemWidgetCreatedHandle(e); ConfigureChart; }")
dash1.ClientSideEvents.ItemWidgetUpdated = ("function(s, e) { ItemWidgetCreatedHandle(e); ConfigureChart; }")

but what the sintaxe to gauge backcolor!?
thanks!

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

To accomplish this task it is necessary to set background color for the gauge container. Use the following script to accomplish this task:

JavaScript
function ConfigureGauge(s, e) { if (e.ItemName.indexOf('gauge') >= 0) { var gauges = e.GetWidget(); if (gauges.length > 0) { gauges[0].element().parents().eq(2).css({ backgroundColor: 'red' }); } } }
ASPx
<dx:ASPxDashboardViewer ID="ASPxDashboardViewer1" ...> <ClientSideEvents ItemWidgetCreated="ConfigureGauge" ItemWidgetUpdated="ConfigureGauge" /> </dx:ASPxDashboardViewer>
    Comments (2)
    JB JB
    Jonathan Barksdale 9 years ago

      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.

      DevExpress Support Team 9 years ago

        Hello,

        To avoid discussing multiple questions within the same thread, I've created a separate ticket on your behalf (T403196: Web Gauge Item - How to change labels font). It has been placed in our processing queue and will be answered shortly.

        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.