private void dashboardViewer1_DashboardItemElementCustomColor(object sender,
                                                                      DashboardItemElementCustomColorEventArgs e)
        {
            MultiDimensionalData data           = e.Data;
            AxisPointTuple       currentElement = e.TargetElement;

            if (e.DashboardItemName == "chartDashboardItem1")
            {
                string country =
                    currentElement.GetAxisPoint(DashboardDataAxisNames.ChartSeriesAxis).Value.ToString();
                decimal value = (decimal)(data.GetSlice(currentElement)).GetValue(e.Measures[0]).Value;
                if (country == "UK" && value > 50000 || country == "USA" && value > 100000)
                {
                    e.Color = Color.DarkGreen;
                }
                else
                {
                    e.Color = Color.DarkRed;
                }
            }
            if (e.DashboardItemName == "pieDashboardItem1")
            {
                decimal value =
                    (decimal)(data.GetSlice(currentElement)).GetValue(data.GetMeasures()[0]).Value;
                if (value < 100000)
                {
                    e.Color = Color.Orange;
                }
            }
        }
Пример #2
0
 private void DControl_DrillUpPerformed(object sender, DrillActionEventArgs e)
 {
     if (HasDashboardItem(e.DashboardItemName))
     {
         string         itemName = e.DashboardItemName;
         int            level    = e.DrillDownLevel;
         AxisPointTuple tuple    = this.dashboardViewer1.GetCurrentDrillDownValues(itemName);
         if (tuple != null)
         {
             AxisPoint point = this.dashboardViewer1.GetCurrentDrillDownValues(itemName).GetAxisPoint();
             int       l     = 0;
             while (point.Parent != null)
             {
                 l++;
                 point = point.Parent;
             }
             if (level + 1 == l && this.dashboardViewer1.CanPerformDrillUp(itemName))
             {
                 this.dashboardViewer1.PerformDrillUp(itemName);
             }
         }
     }
 }