100% Stacked Bars Chart
A stacked bar chart is similar to a standard bar chart except the bars for a given argument will be stacked on top of each other. You can stack the bars vertically or horizontally. This type of chart is used to compare the relationship of parts to the whole. The StackHeight is used to make the bars 100%, but can be 80 for example. The chart will use the lowest value that a series has set and ignore all the larger values.
// Sample Code
'This sample shows how to add a 100% stacked bar
ChartControl.Content.Legend.Visible = True
ChartControl.Content.Legend.HorizontalAlignment = xtpChartLegendFar
ChartControl.Content.EnableMarkup = True
If ChartControl.Content.Series.Count > 0 Then
ChartControl.Content.Series.DeleteAll
End If
ChartControl.Content.Titles.Add "Total Hours Worked"
ChartControl.Content.Legend.Visible = True
ChartControl.Content.Legend.HorizontalAlignment = xtpChartLegendFarOutside
Dim Series As ChartSeries
Set Series = ChartControl.Content.Series.Add("Quoted")
Series.Points.Add "Sam", 11
Series.Points.Add "Jesse", 12
Series.Points.Add "Dave", 4.5
Series.Points.Add "Max", 6
Series.Points.Add "Brian", 5
Set Series = ChartControl.Content.Series.Add("Hourly")
Series.Points.Add "Sam", 12
Series.Points.Add "Jesse", 9.5
Series.Points.Add "Dave", 5
Series.Points.Add "Max", 12
Series.Points.Add "Brian", 11
Set Series = ChartControl.Content.Series.Add("Unbillable")
Series.Points.Add "Sam", 7
Series.Points.Add "Jesse", 2
Series.Points.Add "Dave", 5
Series.Points.Add "Max", 1
Series.Points.Add "Brian", 4
Set ChartControl.Content.Series(0).Style = New ChartStackedBarSeriesStyle
Set ChartControl.Content.Series(1).Style = New ChartStackedBarSeriesStyle
Set ChartControl.Content.Series(2).Style = New ChartStackedBarSeriesStyle
ChartControl.Content.Series(0).Style.StackHeight = 100
ChartControl.Content.Series(1).Style.StackHeight = 100
ChartControl.Content.Series(2).Style.StackHeight = 100
Dim Diagram As ChartDiagram2D
Set Diagram = ChartControl.Content.Series(0).Diagram
Diagram.AxisY.Title.Visible = True
Diagram.AxisY.Title.Text = "Hours"
Diagram.AxisX.Title.Visible = True
Diagram.AxisX.Title.Text = "Employee"
Diagram.AxisX.Label.Angle = 360
// Sample C# Code




