devexpress 通用三种报表图展示

这篇博客介绍了如何使用DevExpress的报表组件展示柱状图、饼图和折线图。通过创建DataTable并设置数据源,根据用户选择的图表类型动态显示图表。每个Series对应一种图表类型,如S1对应柱状图,S2对应饼图,S3对应折线图,并支持数据分组和百分比格式化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraCharts;
namespace StatsReports.Forms
{
    public partial class FormCompositeQueryPieChart : Form
    {
        public DataTable dtReportSource = null;
        public string groupName = "";//进行分组的字段名
        public string groupSum = "";//进行汇总的字段名
        public string groupType = "0";//图表显示类型,默认显示0表示显示全部的三部,1表示柱状图,2表示饼图,3表示折线图
        private Series S1 = new Series("柱状图", ViewType.Bar);
        private Series S2 = new Series("饼图", ViewType.Pie3D);
        private Series S3=new Series("折线图",ViewType.Line);
        private string reportTitle = "";

        public FormCompositeQueryPieChart()
        {
            InitializeComponent();
        }
        public FormCompositeQueryPieChart(DataTable dt,string groupname,string groupsum,string grouptype,string title)
        {
            dtReportSource = dt;
            groupName = groupname;
            groupSum = groupsum;
            groupType = grouptype;
            reportTitle = title;
            InitializeComponent();
       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值