代码之家  ›  专栏  ›  技术社区  ›  Mathias

如何使用.NET在Excel散点图中设置单个点的颜色?

  •  1
  • Mathias  · 技术社区  · 16 年前

    我试图通过C_设置Excel散点图中各个点的颜色,但无法使其正常工作。这是我当前使用的代码。请注意,markerstyle和markersize部分代码有效—所以我的问题实际上是关于颜色。我怀疑我在某个地方找不到演员。

    var point=(excel.point)系列点(index);

    point.markerstyle=xlmarkerstyle.xlmarkerstyleSquare; point.markersize=8点;

    point.markerbackgroundcolor=10; point.markerforegroundcolor=10;

    提前感谢您的洞察力!

    1 回复  |  直到 16 年前
        1
  •  1
  •   Joe Erickson    16 年前

    看起来您希望设置颜色索引而不是RGB(我这么说是因为您将其设置为10)。我相信markerforegroundcolor希望使用RGB颜色。你是想设置markerforgerroundcolorndex吗?

    推荐文章