cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
kayne
Level II

Coloring selective cells

Hi there, how do I color the cells red for values that are lower than the limits? Thanks.

dt = New Table( "Marks",

    Add Rows( 2 ),

    New Column( "Name", Character, Nominal, Set Values( {"Peter", "Leslie"} ) ),

    New Column( "Limits",

        Numeric,

        Continuous,

        Format( "Best", 12 ),

        Set Values( [20, 30] )

    ),

    New Column( "Column 1",

        Numeric,

        Continuous,

        Format( "Best", 12 ),

        Set Values( [10, 15] )

    ),

    New Column( "Column 2",

        Numeric,

        Continuous,

        Format( "Best", 12 ),

        Set Values( [30, 40] )

    ),

    New Column( "Column 3",

        Numeric,

        Continuous,

        Format( "Best", 12 ),

        Set Values( [20, 55] )

    ),

    New Column( "Column 4",

        Numeric,

        Continuous,

        Format( "Best", 12 ),

        Set Values( [53, 24] )

    ),

    Set Row States( [0, 1] )

)

fail = dt << Get Rows Where( :Column 1 < :Limits );

:Column 1 << color cells(Red, fail);

10 REPLIES 10
pmroz
Super User

Re: Coloring selective cells

You have to color by column.  This code will do the trick.  The color "73" is a bit lighter than "Yellow"

for (i = 1, i <= ncols(dinout), i++,
	column(dinout, i) << Color Cells( {73, {40}} );
);

Recommended Articles