I had this working at one point and now I've messed it up and can't get it working again. I am showing a simple pie chart. The only thing not working is all the legend texts are showing as "DataItem" instead of the values it should. in my case "Assigned", "Rejected", etc.
The data being returned by the recordset:
39 Request in Progress45 Requested2 To be uploaded34 Needs Review15 Rejected
Private Sub ShowInventory() Dim adoRs As DbDataReader 'create pie chart, add to form Dim pieChart As New UltraPieChart() pieChart.Name = "pieChart" UltraPanel1.ClientArea.Controls.Add(pieChart) pieChart.Dock = DockStyle.Left pieChart.Top = 0 pieChart.Left = 0 pieChart.Height = UltraPanel1.Height pieChart.Width = UltraPanel1.Width - 100 'leave room for legend pieChart.OthersCategoryThreshold = 0 pieChart.SelectionMode = SliceSelectionMode.Single pieChart.LabelMemberPath = "Label" pieChart.ValueMemberPath = "Value" pieChart.ShowDefaultTooltip = True adoRs = GetPieChartData() pieChart.DataSource = New PieChartData(adoRs) ''Add legend Dim legend As New UltraItemLegend() legend.Name = "legend" UltraPanel1.ClientArea.Controls.Add(legend) legend.Anchor = AnchorStyles.None legend.Dock = DockStyle.Right pieChart.Legend = legend legend.BringToFront() adoRs = Nothing End Sub Private Function GetPieChartData() As DbDataReader Dim strSQL As String = "SELECT S.StatusDescription as MyLabel,count(*) as MyValue FROM Acct A " _ & "LEFT OUTER JOIN xStatusCodes S ON S.EzaCode=A.Status " GetPieChartData = My.Application.GlobalAuditDB.MExecuteReader(strSQL) End Function
Never mind. I fixed it by adding this one line:
pieChart.LegendLabelMemberPath = "Label"
Hello Ted,
Apologies for the late reply.
I am glad to hear that you have resolved your issue.
Thank you for using Infragistics components.
Sincerely,
Tihomir TonevAssociate Software DeveloperInfragistics