- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
[Script] How to add in colour gradient
Hi,
I am stuck here, i want to format my column with colour gradient. However, with the script below there is still no colour gradient applied on my column "N". Thanks
R1=(dt<< Tabulate(
Show Control Panel( 0 ),
Show Tooltip( 1 ),
Add Table(
Column Table( Statistics( N )),
Column Table( Grouping Columns( :Name( "test@7721" ) ), Statistics( Row %, N )),
Row Table( Grouping Columns( :Radius ) )
)
)) << Make Into Data Table;
R1<<Column (
"N",
Set Property("Color Gradient",{"Blue to Green to Red", Range( {0, 547, 187.945945945946})}),
Color Cell by Value
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
The "Color Cell by Value" is a separate message and therefore needs to be handled not as part of the Color Gradient property.
R1 = (dt << Tabulate(
Show Control Panel( 0 ),
Show Tooltip( 1 ),
Add Table(
Column Table( Statistics( N ) ),
Column Table( Grouping Columns( :Name( "test@7721" ) ), Statistics( Row %, N ) ),
Row Table( Grouping Columns( :Radius ) )
)
)) << Make Into Data Table;
R1:N << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
Here's one way:
NamesDefaultToHere(1);
dt = NewTable("Test", << addMultipleColumns("N", 20, Numeric));
// Add some data
Wait(3);
cols = dt << getColumnNames("String");
for(c=1, c<=NItems(cols), c++,
Column(dt, cols[c]) << Formula(RandomNormal());
);
dt << addRows(50);
// Add the colour gradient
Wait(3);
for(c=1, c<=NItems(cols), c++,
Column(dt, cols[c]) << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 188} )} ) << Color Cell by Value;
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
The "Color Cell by Value" is a separate message and therefore needs to be handled not as part of the Color Gradient property.
R1 = (dt << Tabulate(
Show Control Panel( 0 ),
Show Tooltip( 1 ),
Add Table(
Column Table( Statistics( N ) ),
Column Table( Grouping Columns( :Name( "test@7721" ) ), Statistics( Row %, N ) ),
Row Table( Grouping Columns( :Radius ) )
)
)) << Make Into Data Table;
R1:N << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
I never thought of that. Thanks a lot for the information. You've been a very big help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
Hi, another question:
Currently i have 20 "N"s, is there a way to modify the script so that i would not need to change 20 times of the "N"
R1:N << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
R1:N1 << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
R1:N2 << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
R1:N3 << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 187.945945945946} )} )
<< Color Cell by Value;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
Here's one way:
NamesDefaultToHere(1);
dt = NewTable("Test", << addMultipleColumns("N", 20, Numeric));
// Add some data
Wait(3);
cols = dt << getColumnNames("String");
for(c=1, c<=NItems(cols), c++,
Column(dt, cols[c]) << Formula(RandomNormal());
);
dt << addRows(50);
// Add the colour gradient
Wait(3);
for(c=1, c<=NItems(cols), c++,
Column(dt, cols[c]) << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {0, 547, 188} )} ) << Color Cell by Value;
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: [Script] How to add in colour gradient
Please start a new discussion when you change the subject. Thanks!