溶液
コンテキストがすべてです!そのため、テキストブロックに小さな折れ線グラフを埋め込むのと同じように、スパークラインディスカッションの文脈でそれらを表示するために、地図の中に小さな棒グラフを埋め込んで、その場所の文脈で変数を比較したい場合があります。私たちのような人 @scwise この提案をaに追加した人ウィッシュリストのエントリ 。
このソリューションは、最近の2つのJMP機能、つまり仮想結合とテーブルセル内の画像をマーカーとして使用する機能を使用して実装できます。Graph Builderが複合グラフからグラフ要素を含むデータテーブルを作成する機能と組み合わせると、この問題を解決するために必要なすべての要素が揃います。最終結果は次のようになります。
US Elections 2008: Obama vs McCain米国選挙2008:オバマ対マケイン
詳細は以下の通りです。
dt1 = Open("$SAMPLE_DATA/US Election 2008.jmp");
// Create per state graphs
gb1 = Graph Builder(
Variables( Y( :Obama ), Y( :McCain, Position( 1 ) ), Page( :State ) ),
Elements( Bar( Y( 1 ), Y( 2 ), Legend( 8 ), Summary Statistic( "Max" ) ) ),
SendToReport(
Dispatch(
{},
"",
ScaleBox( 2 ),
{Min( -0.657608695652174 ), Max( 0.657608695652174 ), Inc( 0.25 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"",
ScaleBox( 3 ),
{Min( -0.657608695652174 ), Max( 0.657608695652174 ), Inc( 0.25 ),
Minor Ticks( 0 )}
),
Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
)
);
// Save graphs as images to data table
dt2 = gb1 << Make into Data Table;
// Tip: save table to enable virtual join
dt2 << Save("$TEMP/ElectionPerStateGraph.jmp");
// Set virtual join between tables
dt2:State << Set Property("Link ID", 1);
dt1:State << Set Property(
"Link Reference",
Reference Table( "$TEMP/ElectionPerStateGraph.jmp" ));
// Use virtually joined graph column as source for markers
col = Column(dt1, "Graph[State]");
col << UseForMarker( 1 );
// Create map with a points overlay using graph markers
dt1 << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( Shape( :State ) ),
Elements( Map Shapes( Legend( 2 ) ), Points( Legend( 3 ) ) )
);