MyException - 我的异常网
当前位置:我的异常网» C# » 关于 chartcontrol 第二坐标轴的有关问题?(winfor

关于 chartcontrol 第二坐标轴的有关问题?(winform)

www.MyException.Cn  网友分享于:2013-02-20  浏览:256次
关于 chartcontrol 第二坐标轴的问题?(winform)
我用的devexpress的chartcontrol插件,每载入一次图片,就多一条Y轴。。。我找不到是什么问题,新手求教?


代码如下

private void simpleButton1_Click(object sender, EventArgs e)
        {
            string reportsales = "select cast(year(a1.SaleBillMakeDate)as varchar(4))+'-'+cast(month(a1.SaleBillMakeDate)as varchar(2)) as 月份,SUM(a1.salebillqty) as 销售,SUM(a1.SaleBillPrice) 销售金额" +
                                " from d_sales a1,b_sku a2"+
                                " where a1.skucode=a2.skucode";
            if (lookupmaintype.EditValue != "")
            {
                reportsales = reportsales + " and a2.MainTypeCode='" + lookupmaintype.EditValue + "' ";
            }
            else {  }
            reportsales=reportsales+" group by cast(year(a1.SaleBillMakeDate)as varchar(4))+'-'+cast(month(a1.SaleBillMakeDate)as varchar(2))"+
                " order by cast(year(a1.SaleBillMakeDate)as varchar(4))+'-'+cast(month(a1.SaleBillMakeDate)as varchar(2))";
            sql.sqloperate sales = new sql.sqloperate();
            DataTable da = new DataTable();
            sales.sqldataadapter(reportsales).Fill(da);
            chartControl1.Series.Clear();
            DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series("销售数量", DevExpress.XtraCharts.ViewType.Bar);
            DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series("销售金额", DevExpress.XtraCharts.ViewType.Bar);
            chartControl1.DataSource = da;
            series1.ValueDataMembers.AddRange(new string[] {"销售"});
            series2.ValueDataMembers.AddRange(new string[] { "销售金额" });
            series1.ArgumentDataMember = "月份";
            series2.ArgumentDataMember = "月份";
            chartControl1.Series.Add(series2);
            chartControl1.Series.Add(series1);

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有