How to arrange bar Series in asp.net???
Posted: Thu Feb 26, 2004 9:54 am
I am using asp.net and Steema TeeChart for .NET v1 to make some reports and display them in IE browser.
But when I am trying to add five groups data into one teechart control, a problem appeared! The every group data bars width are not same and the position is very difficault to control!!!!!
It almost makes me mad,I don't know how to resolve this problem!
Pls help me! Thanks!
My source code is following:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
With tchart1.Chart
.Aspect.View3D = False
.Header.Lines = New String() {"tChart1"}
.Header.Visible = False
.Legend.Visible = False
End With
Dim barSeriesva1 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva2 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva3 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva4 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva5 As New Steema.TeeChart.Styles.Bar()
Dim barAxis1 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis2 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis3 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis4 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
With tchart1.Chart.Axes
.Custom.Add(barAxis1)
.Custom.Add(barAxis2)
.Custom.Add(barAxis3)
.Custom.Add(barAxis4)
.Bottom.Title.Text = "Title 1"
.Bottom.Increment = 10
End With
With barAxis1
.Increment = 10
.Title.Text = "Title 2"
End With
With barAxis2
.Title.Text = "Title 3"
End With
With barAxis3
.Title.Text = "Title 4"
End With
With barAxis4
.Title.Text = "Title 5"
End With
With barSeriesva1
.CustomHorizAxis = tchart1.Chart.Axes.Bottom
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA1"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Red
End With
With barSeriesva2
.CustomHorizAxis = barAxis1
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA2"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Green
End With
With barSeriesva3
.CustomHorizAxis = barAxis2
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA3"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.White
End With
With barSeriesva4
.CustomHorizAxis = barAxis3
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA4"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Blue
End With
With barSeriesva5
.CustomHorizAxis = barAxis4
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA5"
.Brush.Color = System.Drawing.Color.Yellow
End With
With tchart1.Chart
.Series.Add(barSeriesva1)
.Series.Add(barSeriesva2)
.Series.Add(barSeriesva3)
.Series.Add(barSeriesva4)
.Series.Add(barSeriesva5)
End With
End Sub
With barAxis1
.Increment = 10
.Title.Text = "Title 2"
End With
With barAxis2
.Title.Text = "Title 3"
End With
With barAxis3
.Title.Text = "Title 4"
End With
With barAxis4
.Title.Text = "Title 5"
End With
With barSeriesva1
.CustomHorizAxis = tchart1.Chart.Axes.Bottom
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA1"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Red
End With
With barSeriesva2
.CustomHorizAxis = barAxis1
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA2"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Green
End With
With barSeriesva3
.CustomHorizAxis = barAxis2
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA3"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.White
End With
With barSeriesva4
.CustomHorizAxis = barAxis3
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA4"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Blue
End With
With barSeriesva5
.CustomHorizAxis = barAxis4
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA5"
.Brush.Color = System.Drawing.Color.Yellow
End With
With tchart1.Chart
.Series.Add(barSeriesva1)
.Series.Add(barSeriesva2)
.Series.Add(barSeriesva3)
.Series.Add(barSeriesva4)
.Series.Add(barSeriesva5)
End With
[/quote]
But when I am trying to add five groups data into one teechart control, a problem appeared! The every group data bars width are not same and the position is very difficault to control!!!!!
It almost makes me mad,I don't know how to resolve this problem!
Pls help me! Thanks!
My source code is following:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
With tchart1.Chart
.Aspect.View3D = False
.Header.Lines = New String() {"tChart1"}
.Header.Visible = False
.Legend.Visible = False
End With
Dim barSeriesva1 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva2 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva3 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva4 As New Steema.TeeChart.Styles.Bar()
Dim barSeriesva5 As New Steema.TeeChart.Styles.Bar()
Dim barAxis1 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis2 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis3 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
Dim barAxis4 As New Steema.TeeChart.Axis(True, False, tchart1.Chart)
With tchart1.Chart.Axes
.Custom.Add(barAxis1)
.Custom.Add(barAxis2)
.Custom.Add(barAxis3)
.Custom.Add(barAxis4)
.Bottom.Title.Text = "Title 1"
.Bottom.Increment = 10
End With
With barAxis1
.Increment = 10
.Title.Text = "Title 2"
End With
With barAxis2
.Title.Text = "Title 3"
End With
With barAxis3
.Title.Text = "Title 4"
End With
With barAxis4
.Title.Text = "Title 5"
End With
With barSeriesva1
.CustomHorizAxis = tchart1.Chart.Axes.Bottom
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA1"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Red
End With
With barSeriesva2
.CustomHorizAxis = barAxis1
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA2"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Green
End With
With barSeriesva3
.CustomHorizAxis = barAxis2
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA3"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.White
End With
With barSeriesva4
.CustomHorizAxis = barAxis3
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA4"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Blue
End With
With barSeriesva5
.CustomHorizAxis = barAxis4
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA5"
.Brush.Color = System.Drawing.Color.Yellow
End With
With tchart1.Chart
.Series.Add(barSeriesva1)
.Series.Add(barSeriesva2)
.Series.Add(barSeriesva3)
.Series.Add(barSeriesva4)
.Series.Add(barSeriesva5)
End With
End Sub
With barAxis1
.Increment = 10
.Title.Text = "Title 2"
End With
With barAxis2
.Title.Text = "Title 3"
End With
With barAxis3
.Title.Text = "Title 4"
End With
With barAxis4
.Title.Text = "Title 5"
End With
With barSeriesva1
.CustomHorizAxis = tchart1.Chart.Axes.Bottom
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA1"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Red
End With
With barSeriesva2
.CustomHorizAxis = barAxis1
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA2"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Green
End With
With barSeriesva3
.CustomHorizAxis = barAxis2
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA3"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.White
End With
With barSeriesva4
.CustomHorizAxis = barAxis3
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA4"
.BarWidthPercent = 90
.Brush.Color = System.Drawing.Color.Blue
End With
With barSeriesva5
.CustomHorizAxis = barAxis4
.FillSampleValues()
.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll
.Title = "VA5"
.Brush.Color = System.Drawing.Color.Yellow
End With
With tchart1.Chart
.Series.Add(barSeriesva1)
.Series.Add(barSeriesva2)
.Series.Add(barSeriesva3)
.Series.Add(barSeriesva4)
.Series.Add(barSeriesva5)
End With
[/quote]