Subscribe Bookmark RSS Feed

Contextuel information on graph builder

yves38

Occasional Contributor

Joined:

Dec 12, 2016

Hi, I already asked for it but despite the answer that seemed helpful at the beginning I did not succeed to do what I want after many trials and reading of the help.

Maybe my description was not clear enough and surely I'm a beginner in scripting in JMP.

Here is an example of graph builder on which I would like to have a small popup (help info) when I click on 1 bar of the graph. The provided information is related to a column value for the selected row (e.g. column B). It could be also interesting to get the popup information just when the mouse goes on top of a bar (without selecting the bar).

Thanks in advance for provide me with some code lines for this example.

New Table( "Untitled 15",
    Add Rows( 8 ),
    New Column( "P",
        Numeric,
        "Nominal",
        Format( "Best", 12 ),
        Set Values( [1, 2, 3, 4, 5, 6, 7, 8] )
    ),
    New Column( "A col",
        Character,
        "Nominal",
        Set Values(
            {"1234", "123", "12314", "1232", "123123", "13131", "131313", "131323"}
        )
    ),
    New Column( "B col",
        Character,
        "Nominal",
        Set Values(
            {"CAT1", "CAT2", "CAT3", "CAT1", "CAT1", "CAT3", "CAT2", "CAT3"}
        )
    )
)    ;

Graph Builder(
    Size( 534, 448 ),
    Show Control Panel( 0 ),
    Variables( X( :P ), Y( :B col ) ),
    Elements( Histogram( X, Y, Legend( 8 ) ) ),
    SendToReport( Dispatch( {}, "400", LegendBox, {Set Title( "" )} ) )
);

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

The Histogram element seems not to support the automatic labels (that appear when hovering the pointer over the bar). Try a Bar graph, if that works for you.

Use the column Label property for the column(s) with your labels.

 

New Table("Untitled 15",
    Add Rows(8),
    New Column("P", Numeric, "Nominal", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6, 7, 8])),
    New Column("A col",
        Character,
        "Nominal",
        Set Values({"1234", "123", "12314", "1232", "123123", "13131", "131313", "131323"})
    ),
    New Column("B col",
        Character,
        "Nominal",
        Set Values({"CAT1", "CAT2", "CAT3", "CAT1", "CAT1", "CAT3", "CAT2", "CAT3"}),
        Label
    )
);

Graph Builder(
    Size(534, 448),
    Show Control Panel(0),
    Variables(X(:P), Y(:B col)),
    Elements(Bar(X, Y, Legend(8))),
    SendToReport(Dispatch({}, "400", LegendBox, {Set Title("")}))
);

 

 

yves38

Occasional Contributor

Joined:

Dec 12, 2016

Thank you for your answer.

It's work fine with bar graph but I really need the histogram view. It's important to see on different lines the "CAT" information (see my script). Is there any other ways by scripting to superimpose text box on the graph when the mouse is over a bar (or by clicking on it) ?