Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
UltraPieChart UltraItemLegend only shows "DataItem" for text
posted

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 Progress
45 Requested
2 To be uploaded
34 Needs Review
15 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

Parents
No Data
Reply Children