如何在图形生成器中更改所有箱线图置信度菱形颜色?嗨,我想在图形生成器中将所有箱形图的置信度设置为黑色。 请参阅下面的每月销售数据表示例。 我使用“月份”列作为着色变量,但我的置信度菱形不可见,因为它们与箱形图具有相同的颜色。

我尝试添加一个循环以将线条颜色设置为黑色,但这会将箱线图颜色更改为灰色
gb = Graph Builder(
Size( 1805, 897 ),
Show Control Panel( 0 ),
Variables( X( :Month ), Y( :Sales ), Color( :Month ) ),
Elements(
Box Plot(
X,
Y,
Legend( 9 ),
Box Style( "Solid" ),
Confidence Diamond( 1 ),
Fences( 0 )
)
)
);
//tried the method of changing the confidence level line color to black for each box plot,
//but it removes all pre-existing colors
bpseg = gb << Xpath( "//BoxPlotSeg" );
bpseg << Line Color (0);

附件也是数据表,任何帮助将不胜感激
图形回复:如何在图形生成器中更改所有箱线图置信度菱形颜色?通过对您的方法进行一些更改,我能够完成您想要的。

- 创建图表,但不要选择信心钻石
- 右键单击图表并选择 Add=>Box Plot,以添加第二个 Box Plot
- 在第二个箱线图的变量中,展开该部分并取消选择颜色月份
- 现在右键单击图表并选择 2nd Box Plot 并选择 Confidence Diamonds
- 最后,转到图例并右键单击销售并将线条颜色更改为黑色
这是图表中的脚本
Names Default To Here( 1 );
dt = Current Data Table();
Graph Builder(
Variables( X( :Month ), Y( :Sales ), Color( :Month ) ),
Elements(
Box Plot( X, Y, Legend( 4 ), Box Style( "Solid" ), Fences( 0 ) ),
Box Plot( X, Y, Color( 0 ), Legend( 5 ), Confidence Diamond( 1 ) )
),
SendToReport(
Dispatch( {"Box Plot"[2]}, "", OutlineBox, {Close( 0 )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties( 0, {Line Color( 0 )}, Item ID( "Sales", 1 ) )
)}
)
)
);