ThinkGeo.com    |     Documentation    |     Premium Support

Theme : Circles with radius proportional to a value

What is the best way to make a theme with circles of radius proportional to a value (without ClassBreaks) ?


For now, i use a ZedGraph Pie but i have only one value. So my pies have only one slice but i want to hide the knife track.


I don't know if I am clear....

Le Sommer, 
  
   This is pretty easy but will require that we create our own style.  I don’t have time to work up the sample today as I am about to leave but will have one posted over the weekend. 
  
   In a nutshell what we are going to do it create a new style called something like ScalingPointStyle that inherits form PointStyle.  We will add a property of a column name you want to base the value on and also a property for the factor you want.  For example every 1,000 of X value is one size bigger circle.  Next we override the DrawCore method and in there we call the GeoCanvas.DrawCircle and pass in the pen and brush from the style along with the size which is a calculation using the field value and the factor.  We also pass in the feature which is the point where to draw.  We also will override the GetRequiredColumnsCore and in there create a collection and put in the column from the property and pass it back.  That should be it.  Sorry I don’t have the time right now but I already shut down my development environment. 
  
 David

La Sommer,


Here is that sample which generally follows what David said. Let us know if you have any issues.


Thanks,


Ben

 



401-Demo.zip (107 KB)

Thanks, this C# sample works great but en VB, MyPointStyle draws nothing.


It seems to be the same problem as this : gis.thinkgeo.com/Support/Dis....aspx#6574


The DrawCore method is never called.



Le Sommer, 
  
 The same reason as the other post (please check the reply of that post) that if you do not set any properties of a PointStyle, it is supposed to be blank and it will never be drew. In the class MyPointStyle in the above Demo, the property SymbolSolidBrush is set in its constructor and that’s why the DrawCore is called.  
  
 Thanks, 
  
 Ben 


This is the solution !


Thanks



My pleasure:)