Ticket T372413
Visible to All Users

How to control scales in GaugeDashboardItem

created 9 years ago

[DevExpress Support Team: CLONED FROM T372317: Change Range Container of Circular Gauge in dashboard]
Dear Support team,

Could you please give me an example to solve my problem below?

  1. how to change the scale of each item in Circular Gauge in  dashboard ? as you can see in attached file,  i have 4 items however, the scale of each item is follow the one named TOTAL.

Thank you,

Panhavuth

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

Hello Puthy,
Though the Dashboard suite does not provide a built-in feature to customize min and max scale settings, I have researched this case and found the following workaround:

  1. You can use the ItemWidgetCreated client side event to get access to inner gauges.
  2. Using the following code snippet, you can modify the startValue, endValue, majorTick fields:
C#
function OnItemWidgetCreated(s, e) {     if (e.ItemName === "gaugeDashboardItem1") {         var gauges = e.GetWidget();         for (var i = 0; i < gauges.length; i++) {             var roundValue = Math.round(gauges[i].option("value"));             var requideNumberOfDigits = roundValue.toString().length;             var endValue = Math.pow(10, requideNumberOfDigits);             var tickInterval = endValue / 10;             debugger;             gauges[i].option("scale", {                 startValue: 0,                 endValue: endValue,                 majorTick: {                     tickInterval: tickInterval                 }             });         }     } }

I have attached my test sample to illustrate this approach in action. I hope you will find it useful.

    Comments (2)

      Hi!
      and for winforms, vb?

      thanks!

      DevExpress Support Team 8 years ago

        Hello,

        I've created a separate ticket regarding the WinForms controls on your behalf (T496098: How to control scales in GaugeDashboardItem). 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.