這很難用文字解釋,所以請看下面的圖片。 基本上,我希望在主 x 軸下方按類別分組,而不會弄亂排序順序。 雖然可以將類別設置在主 x 軸“上方”,但這看起來不太好,並且會導致在每個條目上繪製類別網格線,而不是僅在其更改時繪製。

因此,您甚至可以在該下方讀取所需的順序,然後關閉第三軸。

Names default to here(1);
dt = New Table( "Test",
Add Rows( 6 ),
New Column( "Desired Order",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6] )
),
New Column( "Category",
Character,
"Nominal",
Set Values( {"A", "B", "B", "A", "A", "B"} )
),
New Column( "Data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6] )
)
);
dt = Graph Builder(
Variables(
X( :Desired Order ),
X( :Category, Position( 1 ) ),
X( :Desired Order, Position( 1 ) ),
Y( :Data ),
Color( :Category )
),
Elements( Points( X( 1 ), X( 2 ), Y, Legend( 107 ) ) ),
SendToReport(
Dispatch(
{},
"Desired Order",
ScaleBox,
{Label Row(
3,
{Automatic Tick Marks( 0 ), Show Major Labels( 0 ),
Show Major Ticks( 0 )}
)}
),
Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
)
);
希望對你有用。