-
Nov 22nd, 2010, 02:45 AM
#1
Thread Starter
New Member
Microsoft StackedArea100 Chart Control
Hi,
Does anyone of working example of Microsoft StackedArea100 Chart Control??
It would be great if anyone share the examples that will allow me to start of with bit of ease.
Thanks in Advance
Mohan
-
Nov 22nd, 2010, 03:28 AM
#2
Re: Microsoft StackedArea100 Chart Control
Here's some code that creates a Column chart:
vb.net Code:
Private Function GetChart(ByVal facilitator As Facilitator, ByVal assessmentCount As Integer?) As Chart Dim categories As AssessmentCategory() = Me.dataContext.AssessmentCategories.ToArray() Dim assessments As Assessment() = Me.dataContext. Assessments. Include("Program"). Include("AssessmentRatings"). Where(Function(a) a.AssessmentTypeID = AssessmentType.Feedback). OrderByDescending(Function(a) a.Program.StartDate). ToArray() If assessmentCount.HasValue Then assessments = assessments.Take(Math.Min(assessmentCount.Value, assessments.Length)).ToArray() End If Dim chart As New Chart With {.Width = 800, .Height = 600} Dim area As New ChartArea Dim legend As New Legend("Programs") With {.Docking = Docking.Right, .TableStyle = LegendTableStyle.Auto, .Title = "Programs"} With area.AxisX .MajorGrid.Enabled = False .Interval = 1.0 End With With area.AxisY .MajorGrid.Enabled = False .Minimum = 0.0 .Maximum = 10.0 .LabelAutoFitStyle = LabelAutoFitStyles.LabelsAngleStep45 End With With chart .Attributes.Add("align", "left") .ChartAreas.Add(area) .Legends.Add(legend) .Titles.Add("Feedback History") End With For Each assessment As Assessment In assessments.OrderBy(Function(a) a.Program.StartDate) Dim series As New Series With {.ChartType = SeriesChartType.Column, .IsValueShownAsLabel = True, .Legend = "Programs", .legendText = assessment.Program.Duration, .YValueType = ChartValueType.Int32} For Each category As AssessmentCategory In categories Dim categoryID As Integer = category.AssessmentCategoryID Dim rating As AssessmentRating = assessment.AssessmentRatings. Single(Function(ar) ar.AssessmentCategoryID = categoryID) series.Points.AddXY(category.Description, rating.Rating) Next chart.Series.Add(series) Next Return chart End Function
You could simply change the ChartType property of the Series to StackedArea100.
Note that that code is from an ASP.NET application so some details would change, but all the types and members have the same names so the bulk would be exactly the same.
-
Nov 22nd, 2010, 05:33 AM
#3
Thread Starter
New Member
Re: Microsoft StackedArea100 Chart Control
Hi,
Thanks for the quick reply.... and shared your snippet.
Below is my issue which I am not able to bring it in the chart.
Eg: Every row in my datatable has Column "Month" which has unique value (Eg- Jan, Feb,March)
Apart from the month column, I have the remaining columns as well...
1: How do i bind the month column from the datatable to Y Axis of the chart?
2: The remaining columns to be binded in the bar of the chart Eg(Contain more than one series eg, English(10),Matchs(50),Science(90)...like this to be displayed in the chart)...
Hope am not confused you....
I would appriciate if you could guide me in this regard.
Regards,
Mohan
-
Nov 22nd, 2010, 05:41 AM
#4
Thread Starter
New Member
Re: Microsoft StackedArea100 Chart Control
It would be greatful if anyone could explain how to bind the datatable to Microsoft StackedArea100 Chart Control.
Regards,
Mohan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|