I have created a bar chart using the graph builder and want to apply a local data filter, column switcher and ref line to the chart. Is it possible to automatically switch the local data filter and reference line depending on which column is selected. At the moment my reference line just completed disappears when I swap between columns. I have 2 possible columns to select, Cpk and Ppk. I want to include a reference line at Cpk = 1.333 and Ppk = 1.333, respective of which is currently being displayed. Similarly, I want to add a local data filter to show only values between the min Cpk/Ppk value and a max value of 1.5 depending on which column is being displayed. Is it possible to do this in the simple graph builder by scripting it or will I need to look in to a dashboard/application? This is what I currently have:
Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables(
X( :Feature ID, Order By( :Cpk , Ascending, Order Statistic( "Mean" ) ) ),
Y( :Cpk )
),
Column Switcher( :Cpk , {: Cpk , :Ppk }),
Elements( Bar( X, Y, Legend( 4 ) ) ),
Local Data Filter(
Add Filter( columns( :Cpk ), Where( :Cpk >= floor(Col Min(:Cpk )) & :Cpk <= 1.5 ) )
),
SendToReport(
Dispatch(
{},
"Cpk ",
ScaleBox,
{Add Ref Line( 1.333, "Solid", "Red", "", 3 )}
),
)
);