Sample Code Provided on Microsoft site is seriously lacking<p>I'm writing to express my displeasure with the sample code which the moderators here are constantly pointing us to. May I make a suggestion to this regard? Can new samples be placed there along with 100% of the code, so it doesn't leave us guessing. Since I suspect most users will be populating their charts using the code-behind page, please let the examples reflect this. Also it would be nice to present BOTH VB &amp; C# versions so it apealls to all audiences. <br/><br/>Also could you provide many examples for each type of chart and also focus on the multiple ways to bind the data? This aspect is seriously lacking. I've looked high and low and cannot find a book on the chart controls. Even though Microsoft has had this control out for about 8 months, Dundas has had it out for years and still no book exists.</p> <p>Also, most users will be populating their charts from a database, so it would also be benefical to provide many examples using database data rather than manually entered values. I'm coming over from classic ASP and having an awful time understanding how to produce these charts properly. I still have yet to figure out how to produce a stackedcolumn chart based on multiple columns. I also do not understand the grouping at all and cannot make it work.</p> <p>This rant isn't meant to bash anyone, I'm purely suggesting some ideas which I feel would benefit everyone.<br/>Thanks,<br/>Paul</p><hr class="sig">pbukowski© 2009 Microsoft Corporation. All rights reserved.Tue, 14 Jul 2009 05:18:40 Zf3079f74-294b-42bc-9d2b-217dfa2f6e96http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f3079f74-294b-42bc-9d2b-217dfa2f6e96http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f3079f74-294b-42bc-9d2b-217dfa2f6e96PaulBukowskihttp://social.msdn.microsoft.com/Profile/en-US/?user=PaulBukowskiSample Code Provided on Microsoft site is seriously lacking<p>I'm writing to express my displeasure with the sample code which the moderators here are constantly pointing us to. May I make a suggestion to this regard? Can new samples be placed there along with 100% of the code, so it doesn't leave us guessing. Since I suspect most users will be populating their charts using the code-behind page, please let the examples reflect this. Also it would be nice to present BOTH VB &amp; C# versions so it apealls to all audiences. <br/><br/>Also could you provide many examples for each type of chart and also focus on the multiple ways to bind the data? This aspect is seriously lacking. I've looked high and low and cannot find a book on the chart controls. Even though Microsoft has had this control out for about 8 months, Dundas has had it out for years and still no book exists.</p> <p>Also, most users will be populating their charts from a database, so it would also be benefical to provide many examples using database data rather than manually entered values. I'm coming over from classic ASP and having an awful time understanding how to produce these charts properly. I still have yet to figure out how to produce a stackedcolumn chart based on multiple columns. I also do not understand the grouping at all and cannot make it work.</p> <p>This rant isn't meant to bash anyone, I'm purely suggesting some ideas which I feel would benefit everyone.<br/>Thanks,<br/>Paul</p><hr class="sig">pbukowskiWed, 01 Jul 2009 01:19:08 Z2009-07-01T01:19:08Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#0fa19d79-2764-463c-96f8-21ef314db93bhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#0fa19d79-2764-463c-96f8-21ef314db93bSean Boonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Sean%20BoonSample Code Provided on Microsoft site is seriously lackingPaul,<br/><br/>First I want to express that we do appreciate the feedback here and I'd like to make sure that you have the resources you are requesting.  Do you have the samples framework from this location  <a href="http://code.msdn.microsoft.com/mschart">http://code.msdn.microsoft.com/mschart</a>?  Also be sure to download the help files which is a separate download.<br/><br/>Many of the examples you are looking for are included in the sample framework based on my understanding of the samples.  There is a whole section on data binding, for example.  There are examples for all, or just about all different chart types.   The samples include all of the code.<br/><br/>If the samples mentioned above are missing some functionality, we would definitely like to know how to make them better.  We have lots of avenues for getting the information out. This forum, our blogs, updated docs, etc.  As far as a book is concerned that is definitely something that could be possible.  If folks would find a book on the chart controls useful, please let us know as that is something we could consider at some point as well, or we would be willing to work with an author on such a book.  Do we think there would be enough demand for such a book?  Let us know.   You can file an issue on Connect, and folks can reply to this message to voice their approval for such an idea as well.  <br/><br/>Again, we definitely do appreciate the feedback here.  Those of us on the team are constantly checking these forums in addition to working on the development of these controls in an effort to bring developers the best data visualization controls we can.  If there's a specific example you need, I'm pretty sure someone here on the team can and would be willing to help.  <br/><br/>Thanks,<br/>Sean<br/><br/><hr class="sig">Program Manager, SQL Server Reporting Services This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights. http://blogs.msdn.com/seanboon http://www.twitter.com/ssrsWed, 01 Jul 2009 06:31:21 Z2009-07-01T06:31:21Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f7d1870d-115e-4a15-870e-763730988a91http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f7d1870d-115e-4a15-870e-763730988a91PaulBukowskihttp://social.msdn.microsoft.com/Profile/en-US/?user=PaulBukowskiSample Code Provided on Microsoft site is seriously lacking<p>Well Sean thank you so much for replying and letting people know you are out there and willing to provide what-ever is necessary. I'm trying to do some very basic things and am struggling. How about providing a section called &quot;Charts for Dummies&quot;? Within that section maybe you could provide 100% of the code (VB &amp; C#) which would help me to create the following types of charts and attributes, based on data from a database:<br/><br/>Chart required = Bar<br/>Chart should show Date value along the X axis (every day up to a max of 30 days)<br/>Chart should show the Town in each Series<br/>Chart should show the No_of_Stops for each date in each Town<br/>Chart should sort by Date, Town (in that order)<br/><br/>Data which exists in db is:<br/>Date (every day)<br/>Town<br/>No_of_Stops<br/><br/>Now I also would like the option of showing a Stacked Bar chart using the exact same data.<br/><br/>If I was doing this 100% from code-behind using VB, what exact code would I write to accomplish this (for the regular Bar chart and then also for the stacked bar chart?)<br/><br/>BTW, I'm currently using the databindcrosstable command for this and if I only set-up my sql to produce 1 day of data, the chart still shows 3 dates with 2 of the dates being blank (just taking up space). How do I change the chart so it only shows a single date?<br/><br/>I know that's alot of questions, but this should all be very basic and yet it still escapes me. I have no idea how to loop through the correct parameters to produce what I need, as I'm guessing the databindcrosstable is just getting me in to trouble.<br/><br/>Thank you very much for any info.<br/>Paul</p> <p> </p><hr class="sig">pbukowskiWed, 01 Jul 2009 23:39:02 Z2009-07-01T23:39:02Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#a356a2c1-48c0-41ab-9adf-a22af9f4d87chttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#a356a2c1-48c0-41ab-9adf-a22af9f4d87cPaulBukowskihttp://social.msdn.microsoft.com/Profile/en-US/?user=PaulBukowskiSample Code Provided on Microsoft site is seriously lacking<p>I may not have made myself very clear in the previous post and I messed up the sort which I need. Here is the sql which I am using:<br/><br/>select Dte,Town,count(1) as No_of_Stops<br/>from Table<br/>group by Dte, Town<br/>order by Dte, No_of_Stops desc<br/><br/>The chart should show the # of stops for each town, for each day.<br/><br/> In addition, we also need to produce the same  chart, but only for a single day; which will show the following:<br/><br/>select Town, Count(1) as No_Of_Stops<br/>from table<br/>group by Town<br/>where Dte = getdate()-1<br/>Order by No_of_Stops desc<br/><br/>I would be happy to post the code of what I have so far if you'd like it? I have greatly simplified these queries but the answer will help me to build the proper solutions.<br/><br/>Please don't leave anything out. If something needs to be dimmed, then write it down !!! As I said, all this should be done from code-behind in VB.<br/><br/>See what I mean; publish a book &quot;Microsoft ASP.NET Chart Control for Dummies&quot; ! The book should assume the user has no clue how to do anything.<br/><br/>Thank you so much !<br/>Paul</p><hr class="sig">pbukowskiThu, 02 Jul 2009 00:07:09 Z2009-07-02T00:07:09Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f5b35e1e-b88a-42d3-b950-2a44ad64fc70http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f5b35e1e-b88a-42d3-b950-2a44ad64fc70PaulBukowskihttp://social.msdn.microsoft.com/Profile/en-US/?user=PaulBukowskiSample Code Provided on Microsoft site is seriously lacking<strong>I wanted to comment about that .chm documentation file which is of no help to me. Let me show you why.<br/>Say I want to learn about the Annotation Class, so I bring it up in the .chm file:</strong><br/> <div> <p>Defines properties and methods common to all annotations. This is an abstract class.</p> <p><strong>Namespace:</strong> System.Web.UI.DataVisualization.Charting<br/><strong>Assembly:</strong> System.Web.DataVisualization (in system.web.datavisualization.dll)</p> <h1 class=heading><span style="cursor:default"><img class=toggle alt="">Syntax</span></h1> <div class=section> <div class=code><span> <table border=0> <tbody> <tr> <th><span>Visual Basic</span></th> </tr> <tr> <td> <pre><span class=keyword>Public</span> <span class=keyword>MustInherit</span> <span class=keyword>Class</span> <span class=identifier>Annotation</span> <span class=keyword>Inherits</span> <strong>ChartNamedElement</strong> <span class=keyword>Implements</span> <strong>IChartMapArea</strong></pre> </td> </tr> </tbody> </table> </span><span style=""> <table border=0> <tbody> <tr> <th><span>C#</span></th> </tr> <tr> <td> <pre><span class=keyword>public</span> <span class=keyword>abstract</span> <span class=keyword>class</span> <span class=identifier>Annotation</span> : <strong>ChartNamedElement</strong>, <strong>IChartMapArea</strong></pre> </td> </tr> </tbody> </table> </span><span style=""> <table border=0> <tbody> <tr> <th><span>C++</span></th> </tr> <tr> <td> <pre><span class=keyword>public</span> <span class=keyword>ref class</span> <span class=identifier>Annotation</span> <span class=keyword>abstract</span> : <span class=keyword>public</span> <strong>ChartNamedElement</strong>, <strong>IChartMapArea</strong></pre> </td> </tr> </tbody> </table> </span><span style=""> <table border=0> <tbody> <tr> <th><span>J#</span></th> </tr> <tr> <td> <pre><span class=keyword>public</span> <span class=keyword>abstract</span> <span class=keyword>class</span> <span class=identifier>Annotation</span> <span class=keyword>extends</span> <strong>ChartNamedElement</strong> <span class=keyword>implements</span> <strong>IChartMapArea</strong></pre> </td> </tr> </tbody> </table> </span><span style=""> <table border=0> <tbody> <tr> <th><span>JScript</span></th> </tr> <tr> <td> <pre><span class=keyword>public</span> <span class=keyword>abstract</span> <span class=keyword>class</span> <span class=identifier>Annotation</span> <span class=keyword>extends</span> <strong>ChartNamedElement</strong> <span class=keyword>implements</span> <strong>IChartMapArea</strong></pre> </td> </tr> </tbody> </table> </span></div> </div> <h1 class=heading><span style="cursor:default"><img class=toggle src="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/local/collapse.gif" alt="">Remarks</span></h1> <div class=section> <p>Annotations are commonly used to comment or elaborate on chart elements such as data points. Annotations can also be used to draw custom shapes.</p> <p>By default, annotations are positioned using relative coordinates, with (0,0) representing the top-left corner, and (100,100) representing the bottom-right corner of the chart image. It is also possible to switch from this relative coordinate system to a system that uses axis values. With an axis coordinate system, X and Y, which represent the position of the top-left corner of an annotation, are set using X axis and Y axis values, instead of values that range from 0-100.</p> <p>There are two ways to use axis values when you specify the position and size of an annotation:</p> <ul> <li> <p>Set the <a href="http://social.msdn.microsoft.com/html/ccdd5ce0-c2b4-9166-c7fc-64273817de25.htm">AxisX</a>, <a href="http://social.msdn.microsoft.com/html/649e9b57-5cc1-fe1b-4264-0c5090651057.htm">AxisY</a> or both of these annotation properties to the <a href="http://social.msdn.microsoft.com/html/54c4a3a0-d10c-81a4-682d-f7d94d01a357.htm">AxisX</a> and <a href="http://social.msdn.microsoft.com/html/5156d523-530b-58ba-b137-2b4ebd4fd2ba.htm">AxisY</a> property values of a <a href="http://social.msdn.microsoft.com/html/6f05b172-e248-9333-0f99-08e078a7f855.htm">ChartArea</a> object.</p> </li> <li> <p>Use the <a href="http://social.msdn.microsoft.com/html/19b86981-29cb-bcfb-7f2a-8c34b6c454c2.htm">AnchorDataPoint</a> property to anchor the annotation to a data point. In this case, its positioning is automatically calculated.</p> </li> </ul> <p>All annotations are derived from the <strong>Annotation</strong> class, which can be used to set attributes common to all <strong>Annotation</strong> objects, such as color, position, anchoring and so forth.</p> <br/></div> <h1 class=heading><span style="cursor:default"><img class=toggle src="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/local/collapse.gif" alt="">Inheritance Hierarchy</span></h1> <div class=section><strong>System.Object</strong> <br/>   <a href="http://social.msdn.microsoft.com/html/cf48a7a6-a3c0-d72e-4278-54073e712755.htm">System.Web.UI.DataVisualization.Charting.ChartElement</a> <br/>     <a href="http://social.msdn.microsoft.com/html/3f8aa0f3-181d-f7be-f67c-03db4c157f3b.htm">System.Web.UI.DataVisualization.Charting.ChartNamedElement</a> <br/>      <strong>System.Web.UI.DataVisualization.Charting.Annotation</strong><br/>         <a href="http://social.msdn.microsoft.com/html/ce78630b-7efb-96f6-0314-3019e30813d1.htm">Derived Classes</a> <br/></div> <h1 class=heading><span style="cursor:default"><img class=toggle src="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/local/collapse.gif" alt="">Thread Safety</span></h1> <div class=section>Any public static (<strong>Shared</strong> in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.</div> <h1 class=heading><span style="cursor:default"><img class=toggle src="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/local/collapse.gif" alt="">Platforms</span></h1> <div class=section> <h4 class=subHeading>Development Platforms</h4> For a list of the supported platforms, see <strong>Hardware and Software Requirements for Installing SQL Server 2005.</strong> <p> </p> <h4 class=subHeading>Target Platforms</h4> </div> <h1 class=heading><span style="cursor:default"><img class=toggle src="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/local/collapse.gif" alt="">See Also</span></h1> <div class=section> <div> <h4 class=subHeading>Reference</h4> <a href="http://social.msdn.microsoft.com/html/ffbf0ccf-86f1-eb36-4e0c-2e40f04c5ba6.htm">Annotation Members</a><br/><a href="http://social.msdn.microsoft.com/html/78d8811f-3879-e1b2-33b5-f33d3edbada4.htm">System.Web.UI.DataVisualization.Charting Namespace</a><br/></div> </div> </div> <div><a name=feedback></a><span class=feedbackcss> <div><form> <h5 style="margin-bottom:0.7em">Documentation Feedback</h5> <p>Microsoft values your feedback. To rate this topic and send feedback about this topic to the documentation team, click a rating, and then click <strong>Send Feedback</strong>. For assistance with support issues, refer to the technical support information included with the product.</p> <table border=0> <tbody> <tr> <td>Poor</td> <td class=fbinputtd align=right>1<br/><input type=radio value=0></td> <td class=fbinputtd align=right>2<br/><input type=radio value=0></td> <td class=fbinputtd align=right>3<br/><input type=radio value=0></td> <td class=fbinputtd align=right>4<br/><input type=radio value=0></td> <td class=fbinputtd align=right>5<br/><input type=radio value=0></td> <td>Outstanding</td> </tr> </tbody> </table> <p>To e-mail your feedback to Microsoft, click here:    <input type=button value="Send Feedback"></p> </form></div> </span><a href="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96/cf0892e4-d3eb-40ed-aab0-c2e6151cf879.htm">© 2008 Microsoft Corporation. All rights reserved. </a><br/><br/><strong>All the above appears with absolutely no examples on how to use anything in the Annotation class. The above info is all completely useless to me. So let's drill down into some of the sub menus of the annotation class (surely there must be some example code in there): Nope, just more of the same which leaves me guessing on how to use any of it,  absolutely terrible.<br/></strong></div><hr class="sig">pbukowskiThu, 02 Jul 2009 00:25:28 Z2009-07-02T00:25:28Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#72cb6660-bb3f-4777-a67b-5a96f01ee4f5http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#72cb6660-bb3f-4777-a67b-5a96f01ee4f5Jayaram Krishnaswamyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Jayaram%20KrishnaswamySample Code Provided on Microsoft site is seriously lackingI have been trying to fill this 'lacuna' with my articles. You may want to check out these articles with very easy to follow steps. There are simple VB.NET as well as C# (for those who cringe when you mention VB) snippets that should help. <div><br/></div> <div><a href="http://dotnetslackers.com/articles/sql/Importing-MS-Excel-data-to-SQL-Server-2008.aspx">http://dotnetslackers.com/articles/sql/Importing-MS-Excel-data-to-SQL-Server-2008.aspx</a></div> <div><br/></div> <div><a href="http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part1.aspx">http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part1.aspx</a></div> <div><br/></div> <div><a href="http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part2.aspx">http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part2.aspx</a></div> <div><br/></div> <div>While on the subject of demystifying Microsoft's wizardry, I have written two books in the past two years which should help beginners to ramp up their skills in these  areas in a matter of weeks.</div> <div><br/></div> <div>This and many other 'Microsoft for Dummies' are in my blog:</div> <div><br/></div> <div><a href="http://hodentek.blogspot.com">http://hodentek.blogspot.com</a></div> <div><br/></div> <div>Of course I have profitted a lot from my association with MSDN forums without which I could not have done any of these things, for which I am grateful.</div> <div><br/></div> <hr class=sig> mysorianThu, 02 Jul 2009 14:44:31 Z2009-07-02T17:47:32Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#dd3825ad-1a2d-4104-9d49-98da3a25b36chttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#dd3825ad-1a2d-4104-9d49-98da3a25b36cPaulBukowskihttp://social.msdn.microsoft.com/Profile/en-US/?user=PaulBukowskiSample Code Provided on Microsoft site is seriously lackingHi Jayaram,<br/><br/>Great article you put together on the the chart controls. It was very easy to follow and I understand it thoroughly. Keep it rolling though, can you write some more?<br/><br/>Thanks,<br/>Paul<hr class="sig">pbukowskiThu, 02 Jul 2009 22:17:12 Z2009-07-02T22:17:12Zhttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f79f86fc-0d60-4c23-a26f-046e54cfcd8ahttp://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/f3079f74-294b-42bc-9d2b-217dfa2f6e96#f79f86fc-0d60-4c23-a26f-046e54cfcd8aJayaram Krishnaswamyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Jayaram%20KrishnaswamySample Code Provided on Microsoft site is seriously lackingAt your service. Make sure you rate the articles and the books.Thanks<hr class="sig">mysorianMon, 06 Jul 2009 10:28:23 Z2009-07-06T10:28:23Z