stacked column graph in VS2010

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt Hi, David. How are you?
<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt I would like to build a stacked column graph in Visual Studio to represent the data in the array AnnualData with the set of values in Year in the X-axes. Both
arrays have integer data and are already fully completed.
<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt Can you give me a boost? My code so far is the following…



<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green Begin of Chart definition
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim AnnualData (num_rows-1, num_cols - 1) <span style="color:blue
As <span style="color:blue Double
<span style="font-family:Consolas; font-size:9.5pt
<span style="color:blue Dim Year (num_cols - 1) <span style="color:blue
As <span style="color:blue Integer

<span style="font-family:Consolas; font-size:9.5pt
<span lang="EN-US" style="font-family:Consolas; color:blue; font-size:9.5pt With<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt Chart1
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green defines the graph type
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .Series(0).ChartType = DataVisualization.Charting.<span style="color:#2b91af SeriesChartType.StackedColumn
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green defines the legend text
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .Series(0).LegendText =


<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green defines the y title
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisY.Title =
<span style="color:#a31515 "Quantity"
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisY.TitleFont =
<span style="color:blue New <span style="color:#2b91af Font(<span style="color:#a31515 "Times New Roman", 12,
<span style="color:#2b91af FontStyle.Bold)
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisY.TitleForeColor =
<span style="color:#2b91af Color.Blue
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green defines the x title
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisX.Title =
<span style="color:#a31515 "Technology"
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisX.TitleFont =
<span style="color:blue New <span style="color:#2b91af Font(<span style="color:#a31515 "Times New Roman", 12,
<span style="color:#2b91af FontStyle.Bold)
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).AxisX.TitleForeColor =
<span style="color:#2b91af Color.Blue

<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green defines the colour
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .Palette =
<span style="color:#2b91af ChartColorPalette.Fire

<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green set data
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .Series(0).Points.DataBindXY(Year, AnnualData)
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt

<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green show data on graph
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .Series(0).IsValueShownAsLabel =
<span style="color:blue False
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green 3D
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt .ChartAreas(0).Area3DStyle.Enable3D =
<span style="color:blue True

<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:blue End <span style="color:blue With
<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt
<span style="color:green End of Chart definition


<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt Thank you very much.

<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt Best regards,
<span lang="EN-US" style="font-family:Calibri,sans-serif; color:#1f497d; font-size:11pt Nuno.

View the full article
 

Similar threads

Back
Top