Ticket Q322957
Visible to All Users

XtraChart Binding data source

created 14 years ago

I get the following error:The type of the "Sum" value data member isn't compatible with the Numerical scale. So, can you show me the way to solve this error.Please help me!
Regards,
Angela

Comments (3)
DevExpress Support Team 14 years ago

    Hi Angela,
    The error message is self-explanatory. It looks like you are using a non-numerical data field ("Sum") to initialize the Series.ValueDataMembers property.
    Chart can represent only numerical or DateTime values (Y-Axis) on its diagram. If you are using the "Sum" data field to initialize the Series.ArgumentDataMember property, try to switch the Series.ArgumentScaleType property to Qualitative.
    See also: ScaleType Members.
    Thanks,
    Alex

      I see. But my ValueDataMembers is Numerical.And i don't know why it not run!..Please help me!.
       private DataTable bieudo;
              private ChartTitle title;
              Series series1;
            private void InitializeChart()
              {
                // data type of colum Tentrai is string and of colum Soluong is int
                  string sql = "select Tentrai,Soluong from trangtrai";
                  bieudo= MapGlobal.Soluongdich(sql);

      series1 = new Series("Số lượng dịch", ViewType.ManhattanBar);
                      lineChart.Series.Add(series1);

      series1.DataSource = bieudo;

      // Specify data members to bind the series.
                      series1.ArgumentScaleType = ScaleType.Qualitative;
                      series1.ArgumentDataMember = "Tentrai";
                      series1.ValueScaleType = ScaleType.Numerical;
                      series1.ValueDataMembers.AddRange(new string[] {"Soluong"});
                      // Here is Error: The type of the "Soluong" value data member isn't compatible with the Numerical scale.
                      // Add a chart title.
                      title = new ChartTitle();
                      title.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                      title.Text = "Biểu Đồ Tổng Số Lượng Dịch Các Trại Theo Khoảng Thời Gian";
                      title.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
                      lineChart.Titles.Add(title);
                      // Dock the chart into its parent and add it to the current form.
                      lineChart.OptionsPrint.SizeMode = DevExpress.XtraCharts.Printing.PrintSizeMode.Stretch;
                      lineChart.RuntimeSelection = true;
                      lineChart.Visible = true;
                      lineChart.Dock = DockStyle.Fill;
                      lineChart.Legend.MarkerSize = new System.Drawing.Size(16, 16);
                      pneBieudodich.Controls.Add(lineChart);
                      //pneBieuDoNam.Controls.Add(lineChart);
                  //}
              }

      DevExpress Support Team 14 years ago

        Hi Angela,
        Thank you for your response. Could you please post your 'bieudo' object definition here, so that I can try to reproduce this problem locally?
        Your cooperation is appreciated.
        Thanks,
        Alex

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.