This is a migrated thread and some comments may be shown as answers.

How to assign values for two series of Radpiechart

0 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kishor
Top achievements
Rank 2
Kishor asked on 18 Jul 2013, 06:22 AM
hello sir

 I have Piechart with two series
my x values for both series is same but y values are diffrent

but when i assign them ,both the series are updated with values of series 2


For both series I am passing different values , but when i assign Datatable to RadChart2 it takes only values of series 2 and assign for both series

please help me
waiting for reply

 
<telerik:RadChart ID="RadChart2" runat="server" Height="400px" Visible ="false" Skin ="DeepBlue"
              Width="900px" OnItemDataBound="RadChart2_ItemDataBound" AutoLayout="true" AutoTextWrap="true" IntelligentLabelsEnabled ="true" >
      <Series>
            <telerik:ChartSeries Name="Cost_Of_Job" Type="Pie" DataYColumn="Count"  >
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
             
            <telerik:ChartSeries Name="Total_Invoice" Type="Pie" DataYColumn="Count" Visible ="false">
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
        </Series>
         
     </telerik:RadChart>

Protected Sub UpdateChart2(ByVal one As Double, ByVal two As Double, ByVal three As Double, ByVal four As Double, ByVal five As Double, ByVal six As Double, ByVal seven As Double, ByVal eight As Double, ByVal nine As Double)
 
       Try
           tblCostInvoiceheader.Visible = True
           tblCostInvoiceDetails.Visible = True
           RadChart2.ChartTitle.TextBlock.Text = cbChartBy.Text
           Dim salesSeries As ChartSeries = RadChart2.GetSeries("Cost_Of_Job")
           Dim InvoiceSeries As ChartSeries = RadChart2.GetSeries("Total_Invoice")
           InvoiceSeries.Visible = False
           InvoiceRow.Visible = False
 
 
 
           Dim Total As Double = 0
           Dim one1 As Double = one
           Dim two1 As Double = two
           Dim three1 As Double = three
           Dim four1 As Double = four
           Dim five1 As Double = five
           Dim six1 As Double = six
           Dim seven1 As Double = seven
           Dim eight1 As Double = eight
           Dim nine1 As Double = nine
 
 
           Total = (one + two + three + four + five + six + seven + eight + nine)
 
           one1 = ((one / Total) * 100)
           two1 = ((two / Total) * 100)
           three1 = ((three / Total) * 100)
           four1 = ((four / Total) * 100)
           five1 = ((five / Total) * 100)
           six1 = ((six / Total) * 100)
           seven1 = ((seven / Total) * 100)
           eight1 = ((eight / Total) * 100)
           nine1 = ((nine / Total) * 100)
 
          
           Dim dt As New DataTable
           dt.Columns.Add("Invoice")
           dt.Columns.Add("Count")
           dt.Rows.Add(cbInvoiceStatus.Items(0).Text, one1)
           dt.Rows.Add(cbInvoiceStatus.Items(1).Text, two1)
           dt.Rows.Add(cbInvoiceStatus.Items(2).Text, three1)
           dt.Rows.Add(cbInvoiceStatus.Items(3).Text, four1)
           dt.Rows.Add(cbInvoiceStatus.Items(4).Text, five1)
           dt.Rows.Add(cbInvoiceStatus.Items(5).Text, six1)
           dt.Rows.Add(cbInvoiceStatus.Items(6).Text, seven1)
           dt.Rows.Add(cbInvoiceStatus.Items(7).Text, eight1)
           dt.Rows.Add(cbInvoiceStatus.Items(8).Text, nine1)
 
           RadChart2.Series(0).DataYColumn = "Count"
           RadChart2.DataSource = dt
           RadChart2.DataBind()
 
 
           txtBillable.Text = one
           txtBillableST.Text = two
           txtStartUp.Text = three
           txtStartupST.Text = four
           txtTraningService.Text = five
           txtTrainingSTService.Text = six
           txtWarranty.Text = seven
           txtWarrantyST.Text = eight
           txtUnspecifiedCost.Text = nine
 
 
           'if Invoice vs Cost
 
           If cbChartBy.Text = "Invoice vs Cost" Then
 
               Call CostVSInvoice()
               InvoiceRow.Visible = True
               InvoiceSeries.Visible = True
 
               Dim Total1 As Double = 0
               Dim one2 As Double = 0
               Dim two2 As Double = 0
               Dim three2 As Double = 0
               Dim four2 As Double = 0
               Dim five2 As Double = 0
               Dim six2 As Double = 0
               Dim seven2 As Double = 0
               Dim eight2 As Double = 0
               Dim nine2 As Double = 0
 
 
               Total1 = (CountInvBillable + CountInvBillableST + CountInvStartUp + CountInvStartUpST + CountInvTrainingService + CountInvTrainingSTService + CountInvWarranty + CountInvWarrantyST + CountInvCost)
 
               one2 = ((CountInvBillable / Total1) * 100)
               two2 = ((CountInvBillableST / Total1) * 100)
               three2 = ((CountInvStartUp / Total1) * 100)
               four2 = ((CountInvStartUpST / Total1) * 100)
               five2 = ((CountInvTrainingService / Total1) * 100)
               six2 = ((CountInvTrainingSTService / Total1) * 100)
               seven2 = ((CountInvWarranty / Total1) * 100)
               eight2 = ((CountInvWarrantyST / Total1) * 100)
               nine2 = ((CountInvCost / Total1) * 100)
 
             

               Dim dt1 As New DataTable
               dt1.Columns.Add("Invoice")
               dt1.Columns.Add("Count")
               dt1.Rows.Add(cbInvoiceStatus.Items(0).Text, one2)
               dt1.Rows.Add(cbInvoiceStatus.Items(1).Text, two2)
               dt1.Rows.Add(cbInvoiceStatus.Items(2).Text, three2)
               dt1.Rows.Add(cbInvoiceStatus.Items(3).Text, four2)
               dt1.Rows.Add(cbInvoiceStatus.Items(4).Text, five2)
               dt1.Rows.Add(cbInvoiceStatus.Items(5).Text, six2)
               dt1.Rows.Add(cbInvoiceStatus.Items(6).Text, seven2)
               dt1.Rows.Add(cbInvoiceStatus.Items(7).Text, eight2)
               dt1.Rows.Add(cbInvoiceStatus.Items(8).Text, nine2)
 
               RadChart2.Series(1).DataXColumn = "Count"
               RadChart2.DataSource = dt1
               RadChart2.DataBind()
 
 
               txtInvBillable.Text = CountInvBillable
               txtInvBillableST.Text = CountInvBillableST
               txtInvStartUp.Text = CountInvStartUp
               txtInvStartUpST.Text = CountInvStartUpST
               txtInvTrainingService.Text = CountInvTrainingService
               txtInvTrainingSTService.Text = CountInvTrainingSTService
               txtInvWarranty.Text = CountInvWarranty
               txtInvWarrantyST.Text = CountInvWarrantyST
               txtUnspecifiedInvoice.Text = CountInvCost
 
           End If
 
       Catch ex As Exception
           RadWindowManagerchartbyInvoice.RadAlert(Replace(ex.Message.ToString, "'", "\'"), 380, 100, "Error-UpdateChart2", "")
       End Try
 
   End Sub



             

No answers yet. Maybe you can help?

Tags
Editor
Asked by
Kishor
Top achievements
Rank 2
Share this question
or