# Error using ZedGraph charting in Map Suite 3.0 Desktop Edition

**URL:** <https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657>\
**Category:** WinForms\
**Created:** [September 3, 2009, 3:40pm UTC](https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657 "2009-09-03T15:40:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikram\_nagwekar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/ee59a6/32.png) [@vikram\_nagwekar](https://community.thinkgeo.com/u/vikram_nagwekar)\
**Post date:** [September 3, 2009, 3:40pm UTC](https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657/1 "2009-09-03T15:40:33Z")

</div>

Hi,

I'm&nbsp;trying&nbsp;to&nbsp;use&nbsp;the&nbsp;ZedGraph&nbsp;feature&nbsp;to&nbsp;incorporate&nbsp;pie&nbsp;charts&nbsp;using&nbsp;Map&nbsp;Suite&nbsp;3.0&nbsp;Desktop&nbsp;Edition.&nbsp;I've&nbsp;created&nbsp;a&nbsp;test&nbsp;WPF&nbsp;C#&nbsp;solution&nbsp;in&nbsp;Visual&nbsp;Studio&nbsp;2008&nbsp;and&nbsp;referenced&nbsp;the&nbsp;ZedGraph.dll&nbsp;and&nbsp;the&nbsp;ZedGraphStyleExtension.dll&nbsp;in&nbsp;my&nbsp;project.&nbsp;I've&nbsp;used&nbsp;the&nbsp;same&nbsp;code&nbsp;from&nbsp;the&nbsp;ZedGraph&nbsp;sample&nbsp;application&nbsp;in&nbsp;my&nbsp;xaml&nbsp;code&nbsp;behind.&nbsp;I've&nbsp;also&nbsp;referenced&nbsp;the&nbsp;DesktopEdition.dll&nbsp;and&nbsp;the&nbsp;MapSuiteCore.dll.

Whenever,&nbsp;I&nbsp;try&nbsp;to&nbsp;build&nbsp;the&nbsp;solution&nbsp;i&nbsp;get&nbsp;the&nbsp;following&nbsp;error&nbsp;message:

``

`"Unknown build error, 'The specified path, file name or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.' " `

`
`  

**_If&nbsp;I&nbsp;remove&nbsp;the&nbsp;reference&nbsp;to&nbsp;the&nbsp;ZedGraph.dll&nbsp;and&nbsp;ZedGraphStyleExtension.dll,&nbsp;then&nbsp;my&nbsp;solution&nbsp;compiles&nbsp;fine&nbsp;and&nbsp;I&nbsp;can&nbsp;run&nbsp;and&nbsp;view&nbsp;the&nbsp;base&nbsp;world&nbsp;map&nbsp;with&nbsp;the&nbsp;zoom,&nbsp;pan&nbsp;functionality._**

Please&nbsp;advise&nbsp;as&nbsp;to&nbsp;what&nbsp;I&nbsp;need&nbsp;to&nbsp;do&nbsp;to&nbsp;resolve&nbsp;this&nbsp;error&nbsp;and&nbsp;be&nbsp;able&nbsp;to&nbsp;test&nbsp;the&nbsp;ZedGraph&nbsp;feature&nbsp;in&nbsp;my&nbsp;solution.

Thanks,

Vikram

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<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:** [September 4, 2009, 12:09am UTC](https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657/2 "2009-09-04T00:09:27Z")

</div>

Vikram,

Welcome&nbsp;you&nbsp;to&nbsp;ThinkGeo&nbsp;MapSuite&nbsp;Desktop&nbsp;Edition&nbsp;forum!  
&nbsp;  
It&nbsp;seems&nbsp;you&nbsp;are&nbsp;trying&nbsp;to&nbsp;test&nbsp;against&nbsp;is&nbsp;the&nbsp;WPF&nbsp;map&nbsp;control,&nbsp;would&nbsp;you&nbsp;let&nbsp;me&nbsp;know&nbsp;which&nbsp;version&nbsp;are&nbsp;your&nbsp;using&nbsp;now?&nbsp;  
&nbsp;  
We&nbsp;have&nbsp;a&nbsp;sample&nbsp;how&nbsp;to&nbsp;use&nbsp;the&nbsp;ZendGraph&nbsp;as&nbsp;following,&nbsp;can&nbsp;you&nbsp;try&nbsp;to&nbsp;see&nbsp;it&nbsp;works?  
_HowDoI&nbsp;samples\&nbsp;Extending&nbsp;MapSuite\&nbsp;DrawUsingZedGraphStyle_  
&nbsp;  
If&nbsp;you&nbsp;still&nbsp;have&nbsp;problem,&nbsp;can&nbsp;you&nbsp;paste&nbsp;some&nbsp;of&nbsp;your&nbsp;code&nbsp;for&nbsp;us&nbsp;to&nbsp;recreate&nbsp;your&nbsp;problem?  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![vikram\_nagwekar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/ee59a6/32.png) [@vikram\_nagwekar](https://community.thinkgeo.com/u/vikram_nagwekar)\
**Post date:** [September 4, 2009, 10:27am UTC](https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657/3 "2009-09-04T10:27:50Z")

</div>

Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;response.&nbsp;I’m&nbsp;using&nbsp;the&nbsp;map&nbsp;control&nbsp;DesktopEdition.dll&nbsp;ver.&nbsp;3.0.362.0&nbsp;and&nbsp;MapSuiteCore.dll&nbsp;ver.&nbsp;3.1.182.0.&nbsp;The&nbsp;ZedGraph.dll&nbsp;version&nbsp;is&nbsp;5.1.4.31904&nbsp;and&nbsp;ZedGraphStyleExtension.dll&nbsp;ver.&nbsp;3.0.362.0.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;tried&nbsp;the&nbsp;HowDoI&nbsp;sample&nbsp;solution&nbsp;for&nbsp;ZedGraph&nbsp;and&nbsp;it&nbsp;works&nbsp;fine&nbsp;in&nbsp;that&nbsp;solution&nbsp;but&nbsp;the&nbsp;same&nbsp;does&nbsp;not&nbsp;work&nbsp;in&nbsp;my&nbsp;test&nbsp;WPF&nbsp;solution.&nbsp;Here’s&nbsp;the&nbsp;code&nbsp;from&nbsp;my&nbsp;test&nbsp;solution:&nbsp;  
&nbsp;&nbsp;  
&nbsp;Window1.xaml&nbsp;code:&nbsp;  
&nbsp;&nbsp;  
&nbsp;\<Window&nbsp;x:Class=“MapSuiteTest.Window1”&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns=“[schemas.microsoft.com/winfx/2006/xaml/presentation](http://schemas.microsoft.com/winfx/2006/xaml/presentation)”&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:x=“[schemas.microsoft.com/winfx/2006/xaml](http://schemas.microsoft.com/winfx/2006/xaml)”&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:my=“clr-namespace:ThinkGeo.MapSuite.DesktopEdition;assembly=DesktopEdition”&nbsp;Loaded=“Window1\_Load”&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Title=“Window1”&nbsp;Height=“749”&nbsp;Width=“1010”\>&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Grid\>&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<my:WpfMap&nbsp;x:Name=“wpfMap1”&nbsp;Margin=“24,22,0,0”&nbsp;HorizontalAlignment=“Left”&nbsp;VerticalAlignment=“Top”&nbsp;Width=“950”&nbsp;Height=“650”\>\</my:WpfMap\>&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</Grid\>&nbsp;  
&nbsp;\</Window\>&nbsp;  
&nbsp;&nbsp;  
&nbsp;----------------------------------------------------------------------------------------------------------------------------------------------------------------------&nbsp;  
&nbsp;Window1.xaml.cs&nbsp;code:&nbsp;&nbsp;  
&nbsp;NOTE:-&nbsp;All&nbsp;instances&nbsp;of&nbsp;wpfMap1&nbsp;give&nbsp;the&nbsp;error&nbsp;‘The&nbsp;name&nbsp;wpfMap1&nbsp;does&nbsp;not&nbsp;exist&nbsp;in&nbsp;the&nbsp;current&nbsp;context’&nbsp;  
&nbsp;&nbsp;  
&nbsp;using&nbsp;System;&nbsp;  
&nbsp;using&nbsp;System.Collections.Generic;&nbsp;  
&nbsp;using&nbsp;System.Drawing;&nbsp;  
&nbsp;using&nbsp;System.Globalization;&nbsp;  
&nbsp;using&nbsp;System.Linq;&nbsp;  
&nbsp;using&nbsp;System.Text;&nbsp;  
&nbsp;using&nbsp;System.Windows;&nbsp;  
&nbsp;using&nbsp;System.Windows.Controls;&nbsp;  
&nbsp;using&nbsp;System.Windows.Data;&nbsp;  
&nbsp;using&nbsp;System.Windows.Documents;&nbsp;  
&nbsp;using&nbsp;System.Windows.Input;&nbsp;  
&nbsp;using&nbsp;System.Windows.Media;&nbsp;  
&nbsp;using&nbsp;System.Windows.Media.Imaging;&nbsp;  
&nbsp;using&nbsp;System.Windows.Navigation;&nbsp;  
&nbsp;using&nbsp;System.Windows.Shapes;&nbsp;  
&nbsp;using&nbsp;ThinkGeo.MapSuite.Core;&nbsp;  
&nbsp;using&nbsp;ThinkGeo.MapSuite.DesktopEdition;&nbsp;  
&nbsp;using&nbsp;ZedGraph;&nbsp;  
&nbsp;&nbsp;  
&nbsp;namespace&nbsp;MapSuiteTest&nbsp;  
&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///&nbsp;Interaction&nbsp;logic&nbsp;for&nbsp;Window1.xaml&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;partial&nbsp;class&nbsp;Window1&nbsp;:&nbsp;Window&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;delegate&nbsp;Bitmap&nbsp;ToUIThreadDelegate(ZedGraphDrawingEventArgs&nbsp;e);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;Window1()&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();&nbsp;\<—&nbsp;Get&nbsp;message&nbsp;here&nbsp;-&nbsp;“The&nbsp;name&nbsp;InitializeComponent&nbsp;does&nbsp;not&nbsp;exist&nbsp;in&nbsp;this&nbsp;context”&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;void&nbsp;Window1\_Load(object&nbsp;sender,&nbsp;RoutedEventArgs&nbsp;e)&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wpfMap1.MapUnit&nbsp;=&nbsp;GeographyUnit.DecimalDegree;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wpfMap1.CurrentExtent&nbsp;=&nbsp;new&nbsp;RectangleShape(-143.4,&nbsp;109.3,&nbsp;116.7,&nbsp;-76.3);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wpfMap1.BackgroundOverlay.BackgroundBrush&nbsp;=&nbsp;new&nbsp;GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShapeFileFeatureLayer&nbsp;worldLayer&nbsp;=&nbsp;new&nbsp;ShapeFileFeatureLayer(@“C:\Murty\cities\Countries02.shp”);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle&nbsp;=&nbsp;AreaStyles.Country1;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LayerOverlay&nbsp;worldOverlay&nbsp;=&nbsp;new&nbsp;LayerOverlay();&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;worldOverlay.Layers.Add(“WorldLayer”,&nbsp;worldLayer);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wpfMap1.Overlays.Add(“WorldOverlay”,&nbsp;worldOverlay);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wpfMap1.Refresh();&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;void&nbsp;zedGraphStyle\_ZedGraphDrawing(object&nbsp;sender,&nbsp;ZedGraphDrawingEventArgs&nbsp;e)&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.Bitmap&nbsp;=&nbsp;(Bitmap)Dispatcher.Invoke(new&nbsp;ToUIThreadDelegate(ZedGraphDrawing),&nbsp;new&nbsp;object[]&nbsp;{&nbsp;e&nbsp;});&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Bitmap&nbsp;ZedGraphDrawing(ZedGraphDrawingEventArgs&nbsp;e)&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double&nbsp;scale&nbsp;=&nbsp;ExtentHelper.GetScale(wpfMap1.CurrentExtent,&nbsp;(float)wpfMap1.Width,&nbsp;GeographyUnit.DecimalDegree);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Change&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;graph&nbsp;based&nbsp;on&nbsp;the&nbsp;scale.&nbsp;&nbsp;It&nbsp;will&nbsp;get&nbsp;bigger&nbsp;as&nbsp;you&nbsp;zoom&nbsp;in.&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;graphHeight&nbsp;=&nbsp;Convert.ToInt32(1400000000&nbsp;/&nbsp;scale);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LayerOverlay&nbsp;staticOverlay&nbsp;=&nbsp;(LayerOverlay)wpfMap1.Overlays[“CitiesOverlay”];&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChangeLabelPosition(((ShapeFileFeatureLayer)staticOverlay.Layers[“Cities”]),&nbsp;graphHeight);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZedGraphControl&nbsp;zedGraph&nbsp;=&nbsp;new&nbsp;ZedGraphControl();&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.Size&nbsp;=&nbsp;new&nbsp;System.Drawing.Size(graphHeight,&nbsp;graphHeight);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Fill.Type&nbsp;=&nbsp;FillType.None;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Chart.Fill.Type&nbsp;=&nbsp;FillType.None;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Border.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Chart.Border.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.XAxis.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.YAxis.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Legend.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.GraphPane.Title.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PieItem&nbsp;pieItem1&nbsp;=&nbsp;zedGraph.GraphPane.AddPieSlice(Convert.ToDouble(e.Feature.ColumnValues[“WHITE”],&nbsp;CultureInfo.InvariantCulture),&nbsp;GetColorFromGeoColor(GeoColor.StandardColors.LightBlue),&nbsp;0f,&nbsp;“White”);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pieItem1.LabelDetail.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PieItem&nbsp;pieItem2&nbsp;=&nbsp;zedGraph.GraphPane.AddPieSlice(Convert.ToDouble(e.Feature.ColumnValues[“ASIAN”],&nbsp;CultureInfo.InvariantCulture),&nbsp;GetColorFromGeoColor(GeoColor.StandardColors.LightGreen),&nbsp;0f,&nbsp;“Asian”);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pieItem2.LabelDetail.IsVisible&nbsp;=&nbsp;false;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pieItem2.Displacement&nbsp;=&nbsp;0.2;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zedGraph.AxisChange();&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;zedGraph.GraphPane.GetImage();&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;static&nbsp;void&nbsp;ChangeLabelPosition(ShapeFileFeatureLayer&nbsp;shapeFileLayer,&nbsp;int&nbsp;graphHeight)&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((TextStyle)shapeFileLayer.ZoomLevelSet.ZoomLevel01.CustomStyles[1]).XOffsetInPixel&nbsp;=&nbsp;-20;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((TextStyle)shapeFileLayer.ZoomLevelSet.ZoomLevel01.CustomStyles[1]).YOffsetInPixel&nbsp;=&nbsp;Convert.ToSingle(graphHeight&nbsp;\*&nbsp;0.4);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;static&nbsp;System.Drawing.Color&nbsp;GetColorFromGeoColor(GeoColor&nbsp;geoColor)&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;System.Drawing.Color.FromArgb(geoColor.AlphaComponent,&nbsp;geoColor.RedComponent,&nbsp;geoColor.GreenComponent,&nbsp;geoColor.BlueComponent);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;NOTE:&nbsp;If&nbsp;I&nbsp;remove&nbsp;the&nbsp;references&nbsp;to&nbsp;the&nbsp;ZedGraph.dll&nbsp;&&nbsp;ZedGraphStyleExtension.dll&nbsp;in&nbsp;my&nbsp;project&nbsp;and&nbsp;comment&nbsp;out&nbsp;all&nbsp;the&nbsp;ZedGraph&nbsp;related&nbsp;code&nbsp;above,&nbsp;the&nbsp;map&nbsp;control&nbsp;runs&nbsp;fine.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Appreciate&nbsp;your&nbsp;help!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Vikram

---

<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:** [September 6, 2009, 9:04pm UTC](https://community.thinkgeo.com/t/error-using-zedgraph-charting-in-map-suite-3-0-desktop-edition/657/4 "2009-09-06T21:04:47Z")

</div>

Vikram,

Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;code,&nbsp;I&nbsp;reviewed&nbsp;your&nbsp;code&nbsp;and&nbsp;it&nbsp;seems&nbsp;you&nbsp;missed&nbsp;adding&nbsp;the&nbsp;ZendGraphStyle.  
&nbsp;  
I&nbsp;made&nbsp;a&nbsp;separate&nbsp;sample&nbsp;same&nbsp;with&nbsp;HowDoI&nbsp;sample&nbsp;in&nbsp;attachment,&nbsp;please&nbsp;try&nbsp;it.  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
Thanks.  
&nbsp;  
Yale  
  
[1144-Post6233\_Sample.zip](https://community.thinkgeo.com/uploads/default/original/2X/a/ab31661b5309d450892eb0e451e1290920c453b3.zip) (12.4 KB)
