使用C#格式化Excel图表背景 [英] Format Excel Chart Background using C#

查看:160
本文介绍了使用C#格式化Excel图表背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经可以将数据填充到电子表格中,并根据我选择的范围创建图表.但是,在格式化实际图表时,由于它们有太多选择,我感到有些迷茫!

I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!!

这是一个xlCylinderBarStacked类型图表.我只需要将条形的颜色变成漂亮的浅橙色,并使背景变成浅蓝色,在底部逐渐变成白色.

It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make the background a light blue fading into white at the bottom.

有什么主意吗?

推荐答案

只需关闭此问题即可.我对这些属性进行了一些尝试,以下内容在图表背景上实现了渐变效果.

Just to close this question off. I played around a little with the properties and the following achieved the gradient effect on the background of the chart.

xlChart.Interior.Color = ColorTranslator.ToOle(Color.LightSkyBlue);
chart.ChartArea.Fill.TwoColorGradient(
       Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal, 
       1);

这篇关于使用C#格式化Excel图表背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆