I'm working on a tool to help my work. I managed to make a thematic, but the range of values and colors appear automatically. Here is the code:

Dim fRangeLimitsArray() As Float
Dim bBrushStylesArray() As Brush

'Create ranges on selected column
Create Ranges From TABLE_NAME With COLUMN_NAME Use "Equal Count" Number TOTAL_RANGE Round 1 Into Variable fRangeLimitsArray

'Create styles for the specified number of ranges
Create Styles From Brush (2,15597520,16777215) To Brush (2,32768,16777215) Vary Color By "RGB" Number TOTAL_RANGE Into Variable bBrushStylesArray

'Apply thematic
Shade Window FrontWindow() TABLE_NAME With COLUMN_NAME Ranges From Variable fRangeLimitsArray Style Variable bBrushStylesArray

Please help me how to custom value and color range, not automatically.


You variable bBrushStylesArray() holds the styles to be used.

If you don't like the styles created by the Create Styles statement, you can fill the array with your own styles in stead:

Redim bBrushStylesArray(5)
bBrushStylesArray(1) = MakeBrush(2,15597520,16777215)
bBrushStylesArray(2) = MakeBrush(2,262144,16777215)
bBrushStylesArray(3) = MakeBrush(2,131072,16777215)
bBrushStylesArray(4) = MakeBrush(2,65536,16777215)
bBrushStylesArray(5) = MakeBrush(2,32768,16777215)

If you also want to set the ranges manually you need to resize your array to twice the size of the array with Styles. And then yiu can set the low and high value for each of your ranges:

Redim fRangeLimitsArray(Ubound(bBrushStylesArray) * 2)
fRangeLimitsArray(1) = 0
fRangeLimitsArray(2) = 1
fRangeLimitsArray(3) = 1
fRangeLimitsArray(4) = 5
fRangeLimitsArray(5) = 5
fRangeLimitsArray(6) = 10
fRangeLimitsArray(7) = 10
fRangeLimitsArray(8) = 100
fRangeLimitsArray(9) = 100
fRangeLimitsArray(10) = 1000

And then you can use this in your Shade statement

You could also do it in the Shade statement directly:

Shade window FrontWindow() TABLE_NAME with COLUMN_NAME
    0: 1 Brush (2,8421631,16777215) Pen (1,2,0) 
   ,1: 5 Brush (2,10518752,16777215) Pen (1,2,0) 
   ,5: 10 Brush (2,12615872,16777215) Pen (1,2,0) 
   ,10: 100 Brush (2,14712992,16777215) Pen (1,2,0) 
   ,100: 1000 Brush (2,16744576,16777215) Pen (1,2,0) 
  • Ok thank you, I have managed to create a custom color using your command above. And now if you can help me create a custom range of values? – beweka Nov 10 '14 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.