atesfay1 Posted March 24, 2008 Report Share Posted March 24, 2008 Hi, In ChartFX 6.2, I export a Map that contains the underlying data along with the ConditionalAttributes using the GetHtmlTag() method. In ChartFX 7, I wasn't able to find a method that performs this operation. None of the Export methods of the underlying Chart class (it looks likethe Map class now has a Chart object as a member instead of inheriting from the Chart class), were able to export the "processed" SVG file (i.e. the equivalent of the output of the GetHtmlTag() method in ChartFX 6.2). Please help. Thanks Quote Link to comment Share on other sites More sharing options...
Frank Posted March 24, 2008 Report Share Posted March 24, 2008 The equivalent to GetHtmlTag is RenderControl in Chart FX 7. You can also call Export on the chart object. If the Map extension is attached you will get the map output. Quote Link to comment Share on other sites More sharing options...
atesfay1 Posted March 25, 2008 Author Report Share Posted March 25, 2008 Hi Frank, Thanks for the quick reply. Unfortunately, I had tried both options. By the way, what do you mean by "Map extension is attached"? Option 1++++ map1 = new Map(); chart1 = new Chart(); map1.Chart = chart1; ... StringBuilder sb = new StringBuilder(); StringWriter oStringWriter = new StringWriter(sb);System.Web.UI.HtmlTextWriter oWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); map1.RenderControl(oWriter);return sb.ToString(); ++++ sb.ToString() was empty. Option 2+++++++ chart1.Export( FileFormat.Png, "C:\temp\map.png") returned a regular Line Chart. using one of the samples that came with the installation, I was able to find that the Map gallery corresponds to 29959, so I tried the following: chart1.Gallery = (Gallery)29959; chart1.Export( FileFormat.Png, "C:\temp\map.png") In this case, I was able to get a Map output but it didn't have the SVG geography labels, not to mention this hack will break as soon as the internal representation of the Map gallery changes to a different integer. +++++++ Thanks for all your help. Quote Link to comment Share on other sites More sharing options...
Frank Posted March 26, 2008 Report Share Posted March 26, 2008 > By the way, what do you mean by "Map extension is attached"? map1.Chart = chart1; Attach the map extension to the chart. You need to call RenderControl on the Chart object, not on the Map object. I don't see any code here (maybe is not posted) where you select the map you want, the data, etc. It seems that some code is resetting the gallery back to line (the gallery is set to Map when you attach the extension). I will need a full project that reproduces the situation in order to determine what's going wrong. Quote Link to comment Share on other sites More sharing options...
atesfay1 Posted March 26, 2008 Author Report Share Posted March 26, 2008 Frank, Thanks again for the quick reply. Yes, I had skipped the portion that assigns a MapSource and data (two dimensional object array) in the post but it is being done. How should I get the "full project" to you? Thanks. Quote Link to comment Share on other sites More sharing options...
atesfay1 Posted March 26, 2008 Author Report Share Posted March 26, 2008 It works! I should not have used the RenderControl method of the Map object. Thanks for all your help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.