# GradientStyle example?

**URL:** <https://community.thinkgeo.com/t/gradientstyle-example/564>\
**Category:** WinForms\
**Created:** [July 24, 2009, 1:26pm UTC](https://community.thinkgeo.com/t/gradientstyle-example/564 "2009-07-24T13:26:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmccrillis](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ed655f/32.png) [@jmccrillis](https://community.thinkgeo.com/u/jmccrillis)\
**Post date:** [July 24, 2009, 1:26pm UTC](https://community.thinkgeo.com/t/gradientstyle-example/564/1 "2009-07-24T13:26:17Z")

</div>

Map&nbsp;Suite&nbsp;newbie,&nbsp;here.&nbsp;I&nbsp;am&nbsp;searching&nbsp;for&nbsp;a&nbsp;way&nbsp;to&nbsp;draw&nbsp;a&nbsp;set&nbsp;of&nbsp;features&nbsp;with&nbsp;a&nbsp;gradient&nbsp;fill,&nbsp;with&nbsp;the&nbsp;added&nbsp;requirement&nbsp;that&nbsp;the&nbsp;amount&nbsp;of&nbsp;gradient&nbsp;vary&nbsp;based&nbsp;on&nbsp;a&nbsp;column&nbsp;value&nbsp;of&nbsp;each&nbsp;feature.&nbsp;(E.g.&nbsp;if&nbsp;my&nbsp;gradient&nbsp;is&nbsp;from&nbsp;green-to-red&nbsp;with&nbsp;values&nbsp;1-10,&nbsp;a&nbsp;value&nbsp;of&nbsp;1&nbsp;should&nbsp;have&nbsp;green&nbsp;only,&nbsp;and&nbsp;a&nbsp;value&nbsp;of&nbsp;10&nbsp;should&nbsp;be&nbsp;green-to-red).&nbsp;The&nbsp;class&nbsp;"GradientStyle"&nbsp;looks&nbsp;like&nbsp;it&nbsp;is&nbsp;exactly&nbsp;what&nbsp;I&nbsp;need,&nbsp;but&nbsp;I&nbsp;don't&nbsp;quite&nbsp;understand&nbsp;what&nbsp;attritribute&nbsp;of&nbsp;a&nbsp;layer&nbsp;it&nbsp;should&nbsp;be&nbsp;applied&nbsp;to.&nbsp;I&nbsp;have&nbsp;found&nbsp;only&nbsp;1&nbsp;small&nbsp;code&nbsp;example&nbsp;of&nbsp;use&nbsp;of&nbsp;a&nbsp;gradient.&nbsp;I&nbsp;would&nbsp;appreciate&nbsp;an&nbsp;example,&nbsp;or&nbsp;just&nbsp;being&nbsp;pointed&nbsp;at&nbsp;the&nbsp;proper&nbsp;attribute&nbsp;to&nbsp;set&nbsp;to&nbsp;use&nbsp;the&nbsp;GradientStyle,&nbsp;or&nbsp;another&nbsp;method&nbsp;of&nbsp;achieving&nbsp;my&nbsp;requirement.&nbsp;TIA!

Janene&nbsp;M.

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 26, 2009, 8:41pm UTC](https://community.thinkgeo.com/t/gradientstyle-example/564/2 "2009-07-26T20:41:31Z")

</div>

Janene,

Welcome&nbsp;you&nbsp;to&nbsp;ThinkGeo&nbsp;Map&nbsp;Suite&nbsp;Desktop&nbsp;Forum!  
&nbsp;  
I&nbsp;think&nbsp;you&nbsp;Gradient&nbsp;Style&nbsp;is&nbsp;exactly&nbsp;what&nbsp;you&nbsp;are&nbsp;trying&nbsp;to&nbsp;find,&nbsp;following&nbsp;is&nbsp;some&nbsp;snippet&nbsp;of&nbsp;codes&nbsp;you&nbsp;can&nbsp;take&nbsp;reference&nbsp;when&nbsp;using&nbsp;the&nbsp;Gradient&nbsp;Style.  
`ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp");worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1);worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;GradientStyle gradientStyle = new GradientStyle("POP_CNTRY", 0, new GeoSolidBrush(GeoColor.SimpleColors.Green), 2000000000, new GeoSolidBrush(GeoColor.SimpleColors.Red));gradientStyle.RequiredColumnNames.Add("POP_CNTRY");worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(gradientStyle);`

Also,&nbsp;if&nbsp;you&nbsp;want,&nbsp;you&nbsp;also&nbsp;can&nbsp;try&nbsp;to&nbsp;use&nbsp;the&nbsp;ClassBreakStyle&nbsp;or&nbsp;ValueStyle&nbsp;to&nbsp;achieve&nbsp;your&nbsp;requirement,&nbsp;please&nbsp;take&nbsp;a&nbsp;look&nbsp;at&nbsp;the&nbsp;following&nbsp;HowDoI&nbsp;samples:

Styles\Draw&nbsp;features&nbsp;based&nbsp;on&nbsp;values  
Styles\Draw&nbsp;thematic&nbsp;features  
&nbsp;  
Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;other&nbsp;questions.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![jmccrillis](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ed655f/32.png) [@jmccrillis](https://community.thinkgeo.com/u/jmccrillis)\
**Post date:** [July 28, 2009, 6:44pm UTC](https://community.thinkgeo.com/t/gradientstyle-example/564/3 "2009-07-28T18:44:03Z")

</div>

Thanks,&nbsp;Yale,&nbsp;this&nbsp;got&nbsp;me&nbsp;what&nbsp;I&nbsp;wanted.&nbsp;  
  
  
  
Janene

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 29, 2009, 7:55pm UTC](https://community.thinkgeo.com/t/gradientstyle-example/564/4 "2009-07-29T19:55:35Z")

</div>

Janene,&nbsp;you&nbsp;are&nbsp;welcome!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;more&nbsp;questions!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;
