【问题标题】:Changing Color of Individual Bars in Microsoft.Interop.Graph.Chart .NET?更改 Microsoft.Interop.Graph.Chart .NET 中各个条形的颜色?
【发布时间】:2010-12-04 17:19:06
【问题描述】:

谁能帮我看看如何在 C# 中使用 Microsoft Graph PIA 更改每个系列栏的单独颜色?

我尝试了多种方法,但没有任何效果。 Series 对象中有这个 ChartFormatFill 对象,但它是只读的,不允许我更改条形的颜色。

我也尝试过录制一个宏,然后读取它的代码,但由于某些奇怪的原因,更改颜色指令没有被宏化。没有与之对应的代码。

所有图表都存在同样的问题。我无法以编程方式格式化图表系列。

我是少校卡在这里。谁能帮我吗?

谢谢

问候, 穆尼布

【问题讨论】:

    标签: c# asp.net graph pia


    【解决方案1】:

    请尝试:

    使用 Graph = Microsoft.Office.Interop.Graph; 使用 PowerPoint = Microsoft.Office.Interop.PowerPoint; [...] PowerPoint.Application oPowerPoint = new PowerPoint.Application(); [...] PowerPoint.ShapeoShape oShape = oPowerPoint.ActiveWindow.Selection.ShapeRange[1]; [...] Graph.Chart oChart = (Graph.Chart)oShape.OLEFormat.Object; [...] Graph.Series serie = (Graph.Series)oChart.SeriesCollection(1); Graph.Point 点 = (Graph.Point)serie.Points(1); // !!!!!!!!!! 点.Interior.Color = 0x808080; 点 = (Graph.Point)serie.Points(2); point.Interior.Color = 0x800080;

    --
    和平

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-09
      • 2012-03-31
      • 2011-08-03
      • 2012-01-19
      • 1970-01-01
      • 2013-05-10
      • 1970-01-01
      相关资源
      最近更新 更多