Bug Report T291811
Visible to All Users

Web Viewer - It is not possible to specify a color in the ARGB format using the ItemElementCustomColor event

created 9 years ago

Im having trouble setting color to chart and pie chart elements. While using sample provided:
ConditionalColorSample . While it seems to semi work with hex color code and rgb, rgba alpha channel gets completely ignored resulting in incorrect color painting. Code snippet below.

JavaScript
SetCustomColor: function (s, e) { var conditionalColorsArray = dashboardViewer1.cpConditionalColors; var config = $.grep(conditionalColorsArray, function(item) { return item.DasboardItemName === e.ItemName; }); if (config.length === 0) return; var measureDescriptor = e.GetMeasures()[0]; var configEntry = $.grep(config[0].TestEntries, function (entry) { return entry.Measure.ID === measureDescriptor.Id; }); if (configEntry.length === 0) return; var data = dashboardViewer1.GetItemData(e.ItemName); var currentElement = e.GetTargetElement(); var effectiveCondition = configEntry[0].TestDefaultCondition; if (effectiveCondition == null) return; var sliceData = data.GetSlice(currentElement); var measureValue = sliceData.GetMeasureValue(measureDescriptor.Id).GetValue(); if (measureValue == null) return; var nTarget = null; if (effectiveCondition.DynamicTarget != null) { var sliceMeasures = sliceData.GetMeasures(); var targetMeasureDescriptor = $.grep(sliceMeasures, function(measure) { return measure.Id === effectiveCondition.DynamicTarget.Measure.ID; }); if (targetMeasureDescriptor == null) return; var targetValue = sliceData.GetMeasureValue(targetMeasureDescriptor[0].Id).GetValue(); nTarget = targetValue; } else if (effectiveCondition.StaticTarget != null) { nTarget = effectiveCondition.StaticTarget.Value; } if (nTarget == null) return; if (measureValue > nTarget) { e.SetColor(effectiveCondition.RGBAAboveColor); } if (measureValue < nTarget) { e.SetColor(effectiveCondition.RGBABelowColor); } if (measureValue === nTarget) { e.SetColor(effectiveCondition.RGBAEqualsColor); } },

The colors in effective conditions are in "rgba(r,g,b,a)" format.

Comments (1)
DevExpress Support Team 9 years ago

    Hi,
    We've reproduced this behavior and passed this ticket to our developers. As an immediate workaround, please set color in rgb format.

    Answers approved by DevExpress Support

    created 9 years ago (modified 9 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Additional information:

    Hi,
    After you install a hotfix, you will be able to set a color in the rgba format.
    Please note that if you set the color in the wrong format, the default color will be used.

      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.