vsto画箱体图 箱线图 xlboxwhisker

vsto画箱体图 箱线图 xlboxwhisker

using Excel=Microsoft.Office.Interop.Excel;
Excel.Chart lChart = null;
//1完美解决
//既能自动填充,又能可以有数字标签
try
{
Excel.Worksheet lSheet = Globals.ThisAddIn.Application.ActiveSheet;
Globals.ThisAddIn.Application.Range[lSheet.Cells[2, 2], lSheet.Cells[2, 12]].Select();
lChart = lSheet.Shapes.AddChart2(332, (Excel.XlChartType)121, 100, 100, 400, 500, false).Chart;
lChart.SetElement(Microsoft.Office.Core.MsoChartElementType.msoElementChartTitleAboveChart);
lChart.ChartTitle.Text = “箱体图”;
//两个参数都要传递,依然报错 但是可以画出箱体图,如果不传递第二参数 excel自动填充功能被破坏(补偿不能为1)
lChart.Location(Excel.XlChartLocation.xlLocationAsObject, “箱体图”);
}
catch (Exception ex)
{
string str = ex.Message;
}
try
            {
                //设置显示标签
                lChart.SetElement(Microsoft.Office.Core.MsoChartElementType.msoElementDataLabelShow);
            }
            catch
            {
            }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值