MSChart CandleStick颜色选项Powershell

时间:2015-04-20 16:17:00

标签: winforms powershell mschart candlestick-chart

我正在Powershell写一个过程给我一个30天的滚动烛台图表。我有一切工作。但是让我烦恼的一件事就是灯芯线(最小值,最大值)是蓝色(默认的MSChart颜色)。我找不到任何改变这个的选择。

有谁知道它是什么?

1 个答案:

答案 0 :(得分:1)

假设您正在使用 Microsoft .NET Framework 3.5的Microsoft图表控件您可以像这样设置任何数据点颜色......

$Chart.Series["Data"].Points[$index].Color = [System.Drawing.Color]::Red

其中$ index是数据点的索引。

如果要为Max和Min着色,则必须找到它们并设置颜色。

$maxPoint = $Chart.Series["Data"].Points.FindMaxByValue()
$maxPoint.Color = [System.Drawing.Color]::Red

$minPoint = $Chart.Series["Data"].Points.FindMinByValue()
$minPoint.Color = [System.Drawing.Color]::Green

阅读this以获取更详细的说明。