【问题标题】:Shield UI Condtional Item Colorization Based on Series基于系列的 Shield UI 条件项着色
【发布时间】:2014-03-17 14:49:29
【问题描述】:

我正在使用具有多个系列的 ASP.NET 条形图,并且想知道如何将一组单独的条件项着色应用于每个系列。例如:

protected void ShieldChart1_SeriesItemDataBound(object sender, ChartSeriesItemDataBoundEventArgs e)
    {
        ChartSeriesItem item = e.Item as ChartSeriesItem;

        // If Series A, use these colors:

        if (item != null)
        {
            int value = (int)item.ValueY;
            if (value < 20)
            {
                item.Color = Color.Green;
            }
            else if (value > 55)
            {
                item.Color = Color.Yellow;
            }
            else if (value > 60)
            {
                item.Color = Color.Orange;
            }
            if (value > 75)
            {
                item.Color = Color.Red;
            }
        }

        // If Series B, use these colors: ...

    }

提前致谢,

史蒂夫

【问题讨论】:

    标签: shieldui


    【解决方案1】:

    你可能会发现这个带有完整源代码的演示很有用:

    https://shieldui.com/search/content/item.Color

    我认为它可以让您了解如何做您想做的事情,并且还有一些您可能会感兴趣的其他来源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多