JSL在圖上創建線你好,
所以我正在嘗試創建類似於此腳本的紅線
Names Default To Here( 1 );
dt = Current Data Table();
listX = {"1"};
listY = {"test1", "test2", "test3"};
lowLine = 3;
highLine = 5;
bivExpr = Expr(
Bivariate(
Y( Eval List( listY ) ),
X( Eval List( listx ) ),
Fit Spline( 1, Standardized, {Line Color( "Blue" )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Pen Color( "Red" );
Line Style( "dashed" );
X Function( lowLine, x );
X Function( highLine, x );
), Grid Line Order( 1 ), Reference Line Order( 3 )}
)
)
)
);
bivExpr;我的表DT是這樣的:
| 團體 | 測試1 | 測試2 | 測試3 | 1個 | 1個 |
| BL | 1個 | 1個 | 1個 | 1個 | 1個 |
| BL | 2個 | 2個 | 2個 | 2個 | 65歲 |
| BL | 23 | 3 | 6 | 1個 | 1個 |
| POR | 2個 | 2個 | 2個 | 2個 | 2個 |
| 值1 | 1個 | 1個 | 1個 | 3 | 4 |
| POR | 5 | 7 | 2個 | 2個 | 2個 |
| 值1 | 7 | 5 | 1個 | 7 | 3 |
| 值2 | 2個 | 2個 | 2個 | 2個 | 2個 |
| 值0 | 8 | 1個 | 1個 | 1個 | 6 |
結果:

我的問題是如何為每個圖形創建不同的線(對於第一個3-5來說,對於第二個2-7來說是動態的,依此類推)
謝謝!
腳本編寫回复:JSL在圖上創建線使用參考線是我將如何處理此問題

Names Default To Here( 1 );
dt = Current Data Table();
listX = {"1"};
listY = {"test1", "test2", "test3"};
lowList = {3, 2, 1};
highList = {5, 7, 9};
lowLine = 3;
highLine = 5;
bivExpr = Expr(
biv = Bivariate(
Y( Eval List( listY ) ),
X( Eval List( listx ) ),
Fit Spline( 1, Standardized, {Line Color( "Blue" )} )
);
For( i = 1, i <= N Items( listY ), i++,
Report( biv[i] )[AxisBox( 2 )] << add Ref Line( lowList[i], "Dashed", "Red" );
Report( biv[i] )[AxisBox( 2 )] << add Ref Line( highList[i], "Dashed", "Red" );
);
);
bivExpr;