將圖表附加到新窗口中我的數據有兩組輸入數據,我將它們存儲在“源表”列下。
然後,我編寫 for 循環來繪製圖表並從源表中設置本地過濾器。然而,各個圖結果是正確的,在我嘗試附加圖的新窗口中,圖沒有應用本地過濾器。
New Window( "Plot", tb = tab Box() );
For( i = 1, i <= N Items( list ), i++,
obj = Graph Builder(
Size( 1122, 1095 ),
Variables( X( :sequence ), Y( :Data ), Group X( :Source Table), Group X(:SERIAL_NO ), Group Y( :Group ), Overlay( :Label ) ),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table ),
Where( :Source Table == list [i] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
);
tb << append( "Tab",Report( obj ) );
//obj << delete;
);回复:將圖表附加到新窗口中現在我嘗試通過按子組創建不同的“選項卡”來添加另一個圖層。
在側面每個子組將是相同的圖(通過:源表)
下面是腳本。 我創建了新選項卡,但所有繪圖都在選項卡“???”中
Summarize( unique_value = by( :SubGroup) );
list1 = unique_value;
Summarize( unique_value = by( :Source Table ) );
list2 = unique_value;
New Window( "Plot", Tab Box( "The Results", tb = Tab Box(), vlb = V List Box() ) );
For( j = 1, j <= N Items( list1 ), j++,
tb << Add(
"Group" || list1[j],
For( i = 1, i <= N Items( list2 ), i++,
tb << append(
vlb << append(
obj = Graph Builder(
Size( 1122, 1095 ),
Variables(
X( :sequence ),
Y( :Data ),
Group X( :Source Table ),
Group X( :SERIAL_NO ),
Group Y( :Group ),
Overlay( :Label )
),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table, :SubGroup ),
Where( :Source Table == list2[i] ),
Where( :SubGroup == list1[j] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
)
)
)
)
)
);
回复:將圖表附加到新窗口中謝謝。回复:將圖表附加到新窗口中我稍微改變了你的腳本,它似乎運行沒有錯誤。本地過濾器正在做出不同的選擇。這是我的腳本
Names Default To Here( 1 );
dt = Current Data Table();
Summarize( unique_value = by( :Source Table ) );
list = unique_value;
New Window( "Plot", Tab Box( "The Results", tb = H List Box() ) );
For( i = 1, i <= N Items( list ), i++,
tb << append(
obj = Graph Builder(
Size( 1122, 1095 ),
Variables(
X( :sequence ),
Y( :Data ),
Group X( :Source Table ),
Group X( :SERIAL_NO ),
Group Y( :Group ),
Overlay( :Label )
),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table ),
Where( :Source Table == list[i] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
)
)
);
回复:將圖表附加到新窗口中你好,
抱歉沒有說清楚。 我嘗試根據“源表”列創建 2 個圖。 在原始數據中,有 2 個類別(內部和外部)。
我嘗試了您的腳本,但將列表更改回源表類型。
現在該圖顯示在新窗口中,但兩個圖都顯示本地過濾器源表 = 內部。
我想要它顯示
- 第一個圖:本地過濾器源表=內部。
- 第二張圖:本地過濾器源表=外部。
Names Default To Here( 1 );
dt = Current Data Table();
Summarize( unique_value = by( :Source Table ) );
list = unique_value;
New Window( "Plot",
tb = Tab Box(),
For( i = 1, i <= N Items( list ), i++,
tb << append(
obj = Graph Builder(
Size( 1122, 1095 ),
Variables(
X( :sequence ),
Y( :Data ),
Group X( :Source Table ),
Group X( :SERIAL_NO ),
Group Y( :Group ),
Overlay( :Label )
),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table ),
Where( :Source Table == list[i] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
)
);
);
);
回复:將圖表附加到新窗口中我添加了一個名為“list”的列表,並且必須將結束的“)”從 New Window 語句移到代碼末尾。現在它適用於您的樣本數據
names default to here(1);
dt=current data table();
list={"data"};
New Window( "Plot", tb = Tab Box() ,
For( i = 1, i <= N Items( list ), i++,
tb << append(
obj = Graph Builder(
Size( 1122, 1095 ),
Variables(
X( :sequence ),
Y( :Data ),
Group X( :Source Table ),
Group X( :SERIAL_NO ),
Group Y( :Group ),
Overlay( :Label )
),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table ),
Where( :Source Table == list[i] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
)
);
);
);回复:將圖表附加到新窗口中這是樣本。 謝謝。
回复:將圖表附加到新窗口中如果您附上一些示例數據,我會看一下。 我使用的方法是經過測試的方法,我懷疑有一些小問題。回复:將圖表附加到新窗口中你好。特克斯尼爾森
感謝您的快速回复,但它不起作用。 現在它不會在新窗口中添加任何內容,並且對於每個圖表,我都有 2 個圖。回复:將圖表附加到新窗口中試試這個......我沒有數據來測試這個,但是,移動附加以包含實際平台,應該為您提供本地數據過濾器。
New Window( "Plot", tb = Tab Box() );
For( i = 1, i <= N Items( list ), i++,
tb << append(
obj = Graph Builder(
Size( 1122, 1095 ),
Variables(
X( :sequence ),
Y( :Data ),
Group X( :Source Table ),
Group X( :SERIAL_NO ),
Group Y( :Group ),
Overlay( :Label )
),
Elements( Line( X, Y, Legend( 10 ) ) ),
Local Data Filter(
Add Filter(
columns( :Source Table ),
Where( :Source Table == list[i] ),
Display( :Source Table, Size( 181, 34 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Style( "DashDot" )}, Item ID( "CTAP1", 1 ) ),
Properties( 1, {Line Style( "DashDot" )}, Item ID( "CTAP2", 1 ) ),
Properties( 2, {Line Color( 0 ), Line Style( "DashDot" )}, Item ID( "CTAP3", 1 ) ),
Properties( 3, {Line Color( 9 ), Line Style( "DashDot" )}, Item ID( "CTAP4", 1 ) ),
Properties( 4, {Line Style( "Dotted" )}, Item ID( "Inline_X", 1 ) ),
Properties( 5, {Line Style( "Dotted" )}, Item ID( "Inline_Y", 1 ) ),
Properties( 8, {Line Color( 5 )}, Item ID( "MZ1_L", 1 ) ),
Properties( 9, {Line Color( 5 ), Line Style( "Dashed" )}, Item ID( "MZ1_R", 1 ) ),
Properties( 10, {Line Color( 3 )}, Item ID( "MZ2_L", 1 ) ),
Properties( 11, {Line Color( 3 ), Line Style( "Dashed" )}, Item ID( "MZ2_R", 1 ) ),
Properties( 12, {Line Color( 0 )}, Item ID( "MZ3_L", 1 ) ),
Properties( 13, {Line Color( 0 ), Line Style( "Dashed" )}, Item ID( "MZ3_R", 1 ) ),
Properties( 14, {Line Color( 9 )}, Item ID( "MZ4_L", 1 ) ),
Properties( 15, {Line Color( 9 ), Line Style( "Dashed" )}, Item ID( "MZ4_R", 1 ) )
)}
)
)
)
);
);