Sample Code Provided on Microsoft site is seriously lacking
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 & C# versions so it apealls to all audiences.
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.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.
This rant isn't meant to bash anyone, I'm purely suggesting some ideas which I feel would benefit everyone.
Thanks,
Paul
pbukowski
Respuestas
- I 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.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.This and many other 'Microsoft for Dummies' are in my blog: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.
mysorian- EditadoJayaram Krishnaswamy jueves, 02 de julio de 2009 17:47Correct errors
- Marcado como respuestaAlex GorevMSFT, Propietariomartes, 14 de julio de 2009 5:18
Todas las respuestas
- Paul,
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 http://code.msdn.microsoft.com/mschart? Also be sure to download the help files which is a separate download.
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.
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.
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.
Thanks,
Sean
Program Manager, SQL Server Reporting Services This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/seanboon http://www.twitter.com/ssrs 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 "Charts for Dummies"? Within that section maybe you could provide 100% of the code (VB & C#) which would help me to create the following types of charts and attributes, based on data from a database:
Chart required = Bar
Chart should show Date value along the X axis (every day up to a max of 30 days)
Chart should show the Town in each Series
Chart should show the No_of_Stops for each date in each Town
Chart should sort by Date, Town (in that order)
Data which exists in db is:
Date (every day)
Town
No_of_Stops
Now I also would like the option of showing a Stacked Bar chart using the exact same data.
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?)
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?
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.
Thank you very much for any info.
Paul
pbukowskiI 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:
select Dte,Town,count(1) as No_of_Stops
from Table
group by Dte, Town
order by Dte, No_of_Stops desc
The chart should show the # of stops for each town, for each day.
In addition, we also need to produce the same chart, but only for a single day; which will show the following:
select Town, Count(1) as No_Of_Stops
from table
group by Town
where Dte = getdate()-1
Order by No_of_Stops desc
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.
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.
See what I mean; publish a book "Microsoft ASP.NET Chart Control for Dummies" ! The book should assume the user has no clue how to do anything.
Thank you so much !
Paul
pbukowski- I wanted to comment about that .chm documentation file which is of no help to me. Let me show you why.
Say I want to learn about the Annotation Class, so I bring it up in the .chm file:
Defines properties and methods common to all annotations. This is an abstract class.
Namespace: System.Web.UI.DataVisualization.Charting
Assembly: System.Web.DataVisualization (in system.web.datavisualization.dll)Syntax
Visual Basic Public MustInherit Class Annotation Inherits ChartNamedElement Implements IChartMapArea
C# public abstract class Annotation : ChartNamedElement, IChartMapArea
C++ public ref class Annotation abstract : public ChartNamedElement, IChartMapArea
J# public abstract class Annotation extends ChartNamedElement implements IChartMapArea
JScript public abstract class Annotation extends ChartNamedElement implements IChartMapArea
RemarksAnnotations are commonly used to comment or elaborate on chart elements such as data points. Annotations can also be used to draw custom shapes.
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.
There are two ways to use axis values when you specify the position and size of an annotation:
-
Set the AxisX, AxisY or both of these annotation properties to the AxisX and AxisY property values of a ChartArea object.
-
Use the AnchorDataPoint property to anchor the annotation to a data point. In this case, its positioning is automatically calculated.
All annotations are derived from the Annotation class, which can be used to set attributes common to all Annotation objects, such as color, position, anchoring and so forth.
Inheritance HierarchySystem.Object
System.Web.UI.DataVisualization.Charting.ChartElement
System.Web.UI.DataVisualization.Charting.ChartNamedElement
System.Web.UI.DataVisualization.Charting.Annotation
Derived Classes
Thread SafetyAny public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
PlatformsDevelopment Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.Target Platforms
See Also© 2008 Microsoft Corporation. All rights reserved.
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.
pbukowski -
- I 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.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.This and many other 'Microsoft for Dummies' are in my blog: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.
mysorian- EditadoJayaram Krishnaswamy jueves, 02 de julio de 2009 17:47Correct errors
- Marcado como respuestaAlex GorevMSFT, Propietariomartes, 14 de julio de 2009 5:18
- Hi Jayaram,
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?
Thanks,
Paul
pbukowski - At your service. Make sure you rate the articles and the books.Thanks
mysorian

