private void LoadRMPerformanceChart() { double tempAggr = 0; AssetBo assetsBo = new AssetBo(); DataSet dsAssetChart = new DataSet(); DataSet ds = null; try { Series seriesAssets = new Series("RMPerformance"); Legend legend = new Legend("RMPerformanceLegend"); legend.Enabled = true; ds = assetBo.GetAdvisorRM_All_AssetAgr(advisorVo.advisorId); if (ds.Tables[0].Rows.Count > 0) { string[] XValues = new string[ds.Tables[0].Rows.Count]; double[] YValues = new double[ds.Tables[0].Rows.Count]; DataSet RMPerformanceDs = new DataSet(); int j = 0; DataRow drResult; DataRow dr; DataTable dt = new DataTable(); dt.Columns.Add("RMName"); dt.Columns.Add("AggregateValue"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = dt.NewRow(); drResult = ds.Tables[0].Rows[i]; dr[0] = drResult["AR_FirstName"].ToString() + drResult["AR_LastName"].ToString(); tempAggr = Math.Round(Convert.ToDouble(drResult["result"].ToString()), 2); if (tempAggr == 0) { j = j + 1; } dr[1] = tempAggr.ToString(); dt.Rows.Add(dr); } RMPerformanceDs.Tables.Add(dt); if (j != ds.Tables[0].Rows.Count) { // LoadChart seriesAssets.ChartType = SeriesChartType.Pie; ChartRMPerformance.DataSource = RMPerformanceDs.Tables[0].DefaultView; Series series1 = ChartRMPerformance.Series[0]; ChartRMPerformance.Series.Clear(); ChartRMPerformance.Series.Add(seriesAssets); //ChartRMPerformance.Series[0]["CollectedThreshold"] = "5"; ChartRMPerformance.Series[0]["CollectedLegendText"] = "Other"; ChartRMPerformance.Series[0].XValueMember = "RMName"; ChartRMPerformance.Series[0].YValueMembers = "AggregateValue"; ChartRMPerformance.Legends.Add(legend); ChartRMPerformance.Legends["RMPerformanceLegend"].Title = "RM Performance"; ChartRMPerformance.Legends["RMPerformanceLegend"].TitleAlignment = StringAlignment.Center; ChartRMPerformance.Legends["RMPerformanceLegend"].TitleSeparator = LegendSeparatorStyle.DoubleLine; ChartRMPerformance.Legends["RMPerformanceLegend"].TitleSeparatorColor = Color.Black; LegendCellColumn colorColumn = new LegendCellColumn(); colorColumn.ColumnType = LegendCellColumnType.SeriesSymbol; colorColumn.HeaderText = "Color"; colorColumn.HeaderBackColor = Color.WhiteSmoke; ChartRMPerformance.Legends["RMPerformanceLegend"].CellColumns.Add(colorColumn); //LegendCellColumn RMNameColumn = new LegendCellColumn(); //RMNameColumn.ColumnType = LegendCellColumnType.Text; //RMNameColumn.HeaderText = "Name"; //RMNameColumn.Text = "#RMName"; //RMNameColumn.HeaderBackColor = Color.WhiteSmoke; //ChartRMPerformance.Legends["RMPerformanceLegend"].CellColumns.Add(RMNameColumn); LegendCellColumn totalColumn = new LegendCellColumn(); totalColumn.Alignment = ContentAlignment.MiddleLeft; totalColumn.Text = "#VALX: #PERCENT"; totalColumn.HeaderText = "Performance"; totalColumn.Name = "PerformanceColumn"; totalColumn.HeaderBackColor = Color.WhiteSmoke; ChartRMPerformance.Legends["RMPerformanceLegend"].CellColumns.Add(totalColumn); ChartRMPerformance.Series[0]["PieLabelStyle"] = "Disabled"; ChartRMPerformance.Series[0].ToolTip = "#VALX: #VALY"; ChartRMPerformance.ChartAreas[0].Area3DStyle.Enable3D = true; ChartRMPerformance.DataBind(); } else { ChartRMPerformance.DataSource = null; ChartRMPerformance.Visible = false; lblRMPerformChart.Visible = false; } } else { ChartRMPerformance.DataSource = null; ChartRMPerformance.Visible = false; lblRMPerformChart.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "IFAAdminMainDashboard.ascx:LoadRMPerformanceChart()"); object[] objects = new object[3]; objects[0] = advisorVo; objects[1] = ds; objects[2] = tempAggr; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }