Binding an xml to a StackedColumns chart

ESBLEADA

New Member
I have two questions.How do I construct my XML- file which i want to output in a Stacked Column chart using the code-behind?And secondly, How do I put it in the code-behind in vb?This is the code-behind at the moment:\[code\]Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadChart1.Width = 200Chart1.Height = 300Dim XMLFile As XElement = XElement.Load(Server.MapPath("~/xml/XMLFile.xml"))Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.StackedColumnChart1.Series(0).Palette = DataVisualization.Charting.ChartColorPalette.BrightPastelChart1.Series("Series1").IsValueShownAsLabel = True For Each node As XElement In XMLFile.Elements("something") Dim string1 As String = node.Element("whatever1").Value Dim string2 As String = node.Element("whatever2").Value Chart1.Series("Series1").Points.AddXY(string1, string2) Chart1.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True Chart1.ChartAreas("ChartArea1").Area3DStyle.Inclination = 15 Chart1.ChartAreas("ChartArea1").Area3DStyle.Rotation = 15 NextEnd Sub\[/code\]The XMLFile looks something like this at the moment:\[code\]<root> <something> <whatever1>One</whatever1> <whatever2>1</whatever2> </something> <something> <whatever1>Two</whatever1> <whatever2>2</whatever2> </something></root>\[/code\]I need two columns with three different values stacked in each column.How do I do that?
 
Back
Top