Label overlapping in pie chart - vb.net

With Chart2
.Series.Clear()
.Titles.Clear()
.Series.Add("Series1")
End With
Dim series As Series = Chart2.Series("Series1")
series.ChartType = SeriesChartType.Pie
Chart2.DataSource = dt
With Chart2
.ChartAreas(0).Area3DStyle.Enable3D = True
.Series(0).XValueMember = "AccountName"
.Series(0).YValueMembers = "PolicyAmount"
.Series(0).IsValueShownAsLabel = True
.Series(0).Label = "(#VALY) #PERCENT"
.Series(0).LegendText = "#VALX (#VALY)(#PERCENT)"
.Series(0)("PieLabelStyle") = "inside"
.Series(0).Font = New Font("Segoe UI", 9, FontStyle.Bold)
'.Series(0).LabelForeColor = Color.White
.Titles(0).Font = New Font("Segoe UI", 10, FontStyle.Bold)
.Legends(0).Font = New Font("Segoe UI", 9, FontStyle.Bold)
End With
Is there a property which can arrange these labels within the coloured area. is there a angle property or like something m i missing?

Related

Vb.net Change single line font and color of text in textbox

I am making a function which can check strength of password. I have a problem to change single line text font and color. I know that I change text color and font for whole textbox, but is that an option to change only text font and color for single line of text in textbox?
Code:
Function Checker(password)
Dim i, l, c, k As Byte
Dim array() As Char = password.ToCharArray()
For i = 0 To array.Length - 1
If Char.IsUpper(array(i)) Then
c += 1
ElseIf Char.IsLower(array(i)) Then
l += 1
ElseIf Char.IsNumber(array(i)) Then
k += 1
ElseIf Char.IsSymbol(array(i)) Then
i += 1
End If
Next
If i >= 2 And k >= 3 And 2 >= 1 And c >= 2 And password.Length >= 6 Then
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.ForeColor = Color.DarkGreen
pnlCheckPass.txtChcekPass.Text = " - Very strong password"
ElseIf k >= 3 And l >= 2 And c >= 2 And i >= 2 And password.Length >= 6 Then
pnlCheckPass.txtChcekPass.ForeColor = Color.Green
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.Text = " - Strong password"
ElseIf k >= 2 And i >= 1 And c >= 1 And password.Length >= 6 Then
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.ForeColor = Color.Orange
pnlCheckPass.txtChcekPass.Text = " - Medium password"
ElseIf k = 1 And i >= 1 And password.Length = 4 Then
pnlCheckPass.txtChcekPass.BackColor = Color.Red
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.Text = " - Weak password"
ElseIf k = 1 Then
pnlCheckPass.txtChcekPass.ForeColor = Color.DarkRed
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.Text = " - Very weak password"
Else
pnlCheckPass.txtChcekPass.ForeColor = Color.IndianRed
pnlCheckPass.txtChcekPass.Font = New Font("Microsoft YaHei UI", 10)
pnlCheckPass.txtChcekPass.Text = " - Blank password"
End If
Return pnlCheckPass.txtChcekPass.Text
End Function
(Explanations:)
pnlCheckPass - is form where i have a textbox

Dynamically creating textbox on panel scroll in vb.net

Hi i am creating 10 text boxes and combo boxes as a row to populate a sales invoice screen. after user entering to the last text box dynamically created i am populating again 20 more rows and after user entering the 29th text box again i am creating 20 more rows and it goes untill 250 rows created, but i am stuck on which event should i write the code and serial number also i could not generate
Private Sub Panel1_Resize(sender As Object, e As System.EventArgs) Handles Panel1.Enter
Dim viewable As Boolean
If box5(9).Location.Y < Panel1.Height AndAlso box5(9).Location.Y + box5(9).Height > 0 Then
viewable = True
Panel1.HorizontalScroll.Visible = False
Dim x1 As Integer = 100
Dim y1 As Integer = 0
Dim MyLocationX As Integer = 175
Dim MyLocationY As Integer = 175
Dim k As Integer
For i As Integer = 0 To 90
For j As Integer = 11 To 90
box5(i) = New TextBox
box5(i).ReadOnly = True
box5(i).BackColor = Color.White
box5(i).Text = 10 + i
Next j
k = box5(i).Text
box5(i).Font = New Font("Times New Roman", 9)
box5(i).TabStop = False
box5(i).Location = New System.Drawing.Point(0, 200 + i * 20)
box5(i).Size = New System.Drawing.Size(55, 26.2)
box5(i).Multiline = True
AddHandler box5(i).TextChanged, AddressOf Qty_TextChanged
Panel1.Controls.Add(box5(i))
DropDownlist(i) = New ComboBox
DropDownlist(i).Name = (y1 + 1).ToString
DropDownlist(i).Location = New Point(55, 200 + i * 20)
DropDownlist(i).ImeMode = Windows.Forms.ImeMode.KatakanaHalf
DropDownlist(i).DropDownStyle = ComboBoxStyle.DropDown
DropDownlist(i).AutoCompleteSource = AutoCompleteSource.ListItems
DropDownlist(i).AutoCompleteMode = AutoCompleteMode.SuggestAppend
DropDownlist(i).Font = New Font("Times New Roman", 12)
DropDownlist(i).Size = New System.Drawing.Size(150, 50)
AddHandler DropDownlist(i).KeyDown, AddressOf dropdownsearch
AddHandler DropDownlist(i).GotFocus, AddressOf cbsearch
Panel1.Controls.Add(DropDownlist(i))
MyLocationY = MyLocationY + 60
y1 = y1 + 1
box6(i) = New TextBox
box6(i).BackColor = Color.White
box6(i).Font = New Font("Times New Roman", 12)
box6(i).Location = New System.Drawing.Point(199, 200 + i * 20)
box6(i).Size = New System.Drawing.Size(216, 22)
box6(i).ReadOnly = True
AddHandler box6(i).GotFocus, AddressOf combo_TextChanged1
Panel1.Controls.Add(box6(i))
Dim qty1(100) As Double
iname(i) = New TextBox
iname(i).Location = New System.Drawing.Point(412, 200 + i * 20)
iname(i).Size = New System.Drawing.Size(52, 22)
iname(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(iname(i))
AddHandler iname(i).LostFocus, AddressOf combo_TextChanged3
AddHandler iname(i).LostFocus, AddressOf combo_TextChanged66
AddHandler iname(i).LostFocus, AddressOf combo_TextChanged68
Dim rate1(100) As Double
exname1(i) = New TextBox
exname1(i).Location = New System.Drawing.Point(464, 200 + i * 20)
exname1(i).Size = New System.Drawing.Size(61, 22)
exname1(i).Font = New Font("Times New Roman", 12)
rate1(i) = Val(exname1(i).Text)
Panel1.Controls.Add(exname1(i))
box2(i) = New TextBox
box2(i).Location = New System.Drawing.Point(524, 200 + i * 20)
box2(i).Size = New System.Drawing.Size(70, 22)
box2(i).ReadOnly = False
box2(i).BackColor = Color.White
box2(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(box2(i))
gross(i) = New TextBox
gross(i).Location = New System.Drawing.Point(593, 200 + i * 20)
gross(i).Size = New System.Drawing.Size(85, 22)
gross(i).ReadOnly = False
gross(i).BackColor = Color.White
gross(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(gross(i))
disp(i) = New TextBox
disp(i).Location = New System.Drawing.Point(675, 200 + i * 20)
disp(i).Size = New System.Drawing.Size(45, 22)
disp(i).ReadOnly = False
disp(i).BackColor = Color.White
disp(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(disp(i))
net(i) = New TextBox
net(i).Location = New System.Drawing.Point(718, 200 + i * 20)
net(i).Size = New System.Drawing.Size(97, 22)
net(i).ReadOnly = False
net(i).BackColor = Color.White
net(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(net(i))
spc(i) = New TextBox
spc(i).Location = New System.Drawing.Point(814, 200 + i * 20)
spc(i).Size = New System.Drawing.Size(127, 22)
spc(i).ReadOnly = False
spc(i).BackColor = Color.White
spc(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(spc(i))
exdes(i) = New TextBox
exdes(i).Location = New System.Drawing.Point(939, 200 + i * 20)
exdes(i).Size = New System.Drawing.Size(170, 22)
exdes(i).ReadOnly = False
exdes(i).BackColor = Color.White
exdes(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(exdes(i))
fullfill(i) = New DateTimePicker
fullfill(i).Location = New System.Drawing.Point(1107, 200 + i * 20)
fullfill(i).Size = New System.Drawing.Size(100, 22)
fullfill(i).CustomFormat = "dd-MM-yy"
fullfill(i).Format = DateTimePickerFormat.Custom
fullfill(i).BackColor = Color.White
fullfill(i).Font = New Font("Times New Roman", 12)
Panel1.Controls.Add(fullfill(i))
If (String.IsNullOrEmpty(DropDownlist(i).Text)) Then
AddHandler DropDownlist(i).LostFocus, AddressOf combo_TextChanged
AddHandler DropDownlist(i).LostFocus, AddressOf combo_TextChanged2
Else
box6(i).Clear()
End If
Next i
Else
viewable = False
End If
End Sub

Problems adding DataTable as datasource in C1Report (VB) ComponentOne

I'm having troubles to assign a datasource to a code-generated c1report.
This is the datatable data.
This is the output result pdf view.
I'm using Visual Studio 2008 with ComponentOne 2009.
The result pdf file as not the correct data, only the titles repeated to bottom.
Then, this is the vb code:
Public Function DataTableToC1Report(ByVal dtDatos As DataTable, ByVal strTitulo As String) As C1.C1Report.C1Report
Dim c1r As New C1.C1Report.C1Report
'Inicia control
With c1r
'limpia fields existentes
.Clear()
'configura fuente para todos los controles
.Font.Name = "Tahoma"
.Font.Size = 8
End With
'Inicializar diseño
With c1r.Layout
.Orientation = C1.C1Report.OrientationEnum.Portrait
.Width = 6.5 * 1440 ' 8.5 - margen, en twips (aprox. son 567 twips por centímetro)
End With
'Crear encabezado y agregar field para titulo
Dim f As C1.C1Report.Field
With c1r.Sections(C1.C1Report.SectionTypeEnum.Header)
.Height = 1440
.Visible = True
.BackColor = Color.FromArgb(200, 200, 200)
f = .Fields.Add("FldTitle", strTitulo, 0, 0, 8000, 1440)
f.Font.Size = 24
f.Font.Bold = True
f.ForeColor = Color.FromArgb(0, 0, 100)
End With
'Crea footer de página
With c1r.Sections(C1.C1Report.SectionTypeEnum.PageFooter)
.Height = 500
.Visible = True
f = .Fields.Add("FldFtrLeft", """Generado el "" & Now", 0, 0, 4000, 300)
f.Calculated = True
f = .Fields.Add("FldFtrRight", """Página "" & Page & "" de "" & Pages", 4000, 0, 4000, 300)
f.Calculated = True
f.Align = C1.C1Report.FieldAlignEnum.RightTop
f.Width = c1r.Layout.Width - f.Left
f = .Fields.Add("FldLine", "", 0, 0, c1r.Layout.Width, 20)
f.LineSlant = C1.C1Report.LineSlantEnum.NoSlant
f.BorderStyle = C1.C1Report.BorderStyleEnum.Solid
f.BorderColor = Color.FromArgb(0, 0, 100)
End With
'Genera títulos con fields
With c1r.Sections(C1.C1Report.SectionTypeEnum.PageHeader)
.Height = 500
.Visible = True
Dim i As Integer = 0
Dim pIzq As Double = 0
Dim pArriba As Double = 50
Dim pAncho As Double = 800
Dim pAltura As Double = 300
For Each dc As DataColumn In dtDatos.Columns
c1r.Font.Bold = True
f = .Fields.Add("lblCol" & i.ToString, dc.ColumnName, pIzq, pArriba, pAncho, pAltura)
c1r.Font.Bold = False
f.Align = C1.C1Report.FieldAlignEnum.CenterMiddle
i += 1
pIzq += (pAncho + 100)
Next
f = .Fields.Add("FldLine", "", 0, 400, c1r.Layout.Width, 20)
f.LineSlant = C1.C1Report.LineSlantEnum.NoSlant
f.LineWidth = 50
f.BorderColor = Color.FromArgb(100, 100, 100)
End With
'Crea sección de detalle
With c1r.Sections(C1.C1Report.SectionTypeEnum.Detail)
Dim i As Integer = 0
Dim pIzq As Double = 0
Dim pArriba As Double = 0
Dim pAncho As Double = 800
Dim pAltura As Double = 300
.Height = 330
.Visible = True
For Each dc As DataColumn In dtDatos.Columns
c1r.Font.Bold = True
f = .Fields.Add("fldCol" & i.ToString, dc.ColumnName, pIzq, pArriba, pAncho, pAltura)
c1r.Font.Bold = False
f.Calculated = False 'agregar que permita verificar si la columna debe ser calculada y poner en True
f.CanGrow = False 'agregar que permita verificar si la columna puede crecer de tamaño
f.Align = C1.C1Report.FieldAlignEnum.CenterMiddle
'f.Width = c1r.Layout.Width - f.Left
f.Font.Size = 6
i += 1
pIzq += (pAncho + 100)
Next
f = .Fields.Add("FldLine", "", 0, 310, c1r.Layout.Width, 20)
f.LineSlant = C1.C1Report.LineSlantEnum.NoSlant
f.BorderStyle = C1.C1Report.BorderStyleEnum.Solid
f.BorderColor = Color.FromArgb(100, 100, 100)
End With
'Inicializar(DataSource)
With c1r.DataSource
'.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
' "Data Source=C:\...\ComponentOne Samples\Common\C1NWind.mdb;" & _
' "Persist Security Info=False"
'.RecordSource = "Employees"
.Recordset = dtDatos
End With
Return c1r
End Function
I think the issue is because you've set the Calculated property of the fields added in the Detail section to False. You need to set it to True in order to bind data to the fields.

Vb.net custom tab controls

what are some good tab control components out there for free. I have found the Krypton Navigator, but it isnt free. Others don't have the properties I need. Are there any good free tab controls with these properties:
tab page:
.backgroundimage
.image(on tab)
.color(on tab)
tabcontrol:
.selectedpage
.tabshape
.tabsizing(fixed,autosize,etc.)
Yes, there are many custom tab controls, this is one (VB.NET):
Imports System.Drawing.Drawing2D
Class DotNetBarTabcontrol
Inherits TabControl
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer, True)
DoubleBuffered = True
SizeMode = TabSizeMode.Fixed
ItemSize = New Size(44, 136)
End Sub
Protected Overrides Sub CreateHandle()
MyBase.CreateHandle()
Alignment = TabAlignment.Left
End Sub
Function ToPen(ByVal color As Color) As Pen
Return New Pen(color)
End Function
Function ToBrush(ByVal color As Color) As Brush
Return New SolidBrush(color)
End Function
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim B As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(B)
Try : SelectedTab.BackColor = Color.White : Catch : End Try
G.Clear(Color.White)
G.FillRectangle(New SolidBrush(Color.FromArgb(246, 248, 252)), New Rectangle(0, 0, ItemSize.Height + 4, Height))
'G.DrawLine(New Pen(Color.FromArgb(170, 187, 204)), New Point(Width - 1, 0), New Point(Width - 1, Height - 1)) 'comment out to get rid of the borders
'G.DrawLine(New Pen(Color.FromArgb(170, 187, 204)), New Point(ItemSize.Height + 1, 0), New Point(Width - 1, 0)) 'comment out to get rid of the borders
'G.DrawLine(New Pen(Color.FromArgb(170, 187, 204)), New Point(ItemSize.Height + 3, Height - 1), New Point(Width - 1, Height - 1)) 'comment out to get rid of the borders
G.DrawLine(New Pen(Color.FromArgb(170, 187, 204)), New Point(ItemSize.Height + 3, 0), New Point(ItemSize.Height + 3, 999))
For i = 0 To TabCount - 1
If i = SelectedIndex Then
Dim x2 As Rectangle = New Rectangle(New Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), New Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1))
Dim myBlend As New ColorBlend()
myBlend.Colors = {Color.FromArgb(232, 232, 240), Color.FromArgb(232, 232, 240), Color.FromArgb(232, 232, 240)}
myBlend.Positions = {0.0F, 0.5F, 1.0F}
Dim lgBrush As New LinearGradientBrush(x2, Color.Black, Color.Black, 90.0F)
lgBrush.InterpolationColors = myBlend
G.FillRectangle(lgBrush, x2)
G.DrawRectangle(New Pen(Color.FromArgb(170, 187, 204)), x2)
G.SmoothingMode = SmoothingMode.HighQuality
Dim p() As Point = {New Point(ItemSize.Height - 3, GetTabRect(i).Location.Y + 20), New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14), New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 27)}
G.FillPolygon(Brushes.White, p)
G.DrawPolygon(New Pen(Color.FromArgb(170, 187, 204)), p)
If ImageList IsNot Nothing Then
Try
If ImageList.Images(TabPages(i).ImageIndex) IsNot Nothing Then
G.DrawImage(ImageList.Images(TabPages(i).ImageIndex), New Point(x2.Location.X + 8, x2.Location.Y + 6))
G.DrawString(" " & TabPages(i).Text, Font, Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
Else
G.DrawString(TabPages(i).Text, New Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End If
Catch ex As Exception
G.DrawString(TabPages(i).Text, New Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End Try
Else
G.DrawString(TabPages(i).Text, New Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End If
G.DrawLine(New Pen(Color.FromArgb(200, 200, 250)), New Point(x2.Location.X - 1, x2.Location.Y - 1), New Point(x2.Location.X, x2.Location.Y))
G.DrawLine(New Pen(Color.FromArgb(200, 200, 250)), New Point(x2.Location.X - 1, x2.Bottom - 1), New Point(x2.Location.X, x2.Bottom))
Else
Dim x2 As Rectangle = New Rectangle(New Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), New Size(GetTabRect(i).Width + 3, GetTabRect(i).Height + 1))
G.FillRectangle(New SolidBrush(Color.FromArgb(246, 248, 252)), x2)
G.DrawLine(New Pen(Color.FromArgb(170, 187, 204)), New Point(x2.Right, x2.Top), New Point(x2.Right, x2.Bottom))
If ImageList IsNot Nothing Then
Try
If ImageList.Images(TabPages(i).ImageIndex) IsNot Nothing Then
G.DrawImage(ImageList.Images(TabPages(i).ImageIndex), New Point(x2.Location.X + 8, x2.Location.Y + 6))
G.DrawString(" " & TabPages(i).Text, Font, Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
Else
G.DrawString(TabPages(i).Text, Font, Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End If
Catch ex As Exception
G.DrawString(TabPages(i).Text, Font, Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End Try
Else
G.DrawString(TabPages(i).Text, Font, Brushes.DimGray, x2, New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
End If
End If
Next
e.Graphics.DrawImage(B.Clone, 0, 0)
G.Dispose() : B.Dispose()
End Sub
End Class
How to use:
Create a new class then paste the code.
Save your project or debug it, then you will see the new tab page in the toolbox.
Enjoy you new awesome tab page.

ZedGraph - Force all graph panes to be the same size

I am using the ZedGraph control (zgc) to create individual stacked bar charts and display them in a single stacked column as shown in the image below.
The issue that I am having is that I have no control over the number of panes that are displayed in the control as this is determined by the number of items in a listbox. It seems that the default nature of the control allows the height of the graph panes to change depending on the number of panes that are displayed within the control.
The zgc is set to dock=fill within a panel control that is set to dock=fill within the form. I would like to force the graph panes to be a static height and when needed have a vertical scroll bar appear in the panel when the number of graph panes exceeds the height of the form. How can I go about achieving this? My code for creating and populating the zgc is posted below the image.
Private Sub CreateGraph(ByVal dat As Date)
Dim count As Integer = 0
Dim master As MasterPane = zgc.MasterPane
master.Fill = New Fill(Color.FromArgb(180, 180, 180), Color.FromArgb(180, 180, 180), 45.0F)
master.PaneList.Clear()
master.Title.IsVisible = True
master.Title.Text = "Workload for " & dat.ToShortDateString()
master.Margin.All = 10
master.InnerPaneGap = 5
master.IsCommonScaleFactor = False
For Each mach As String In lbMach.Items
rowCount = 0
Dim myPaneT As New GraphPane(New Rectangle(10, 10, 10, 10), "", "Time in Minutes", mach)
myPaneT.Fill.IsVisible = False
myPaneT.Chart.Fill = New Fill(Color.White, Color.White, 45.0F)
myPaneT.BaseDimension = 3.0F
myPaneT.XAxis.Title.IsVisible = False
myPaneT.XAxis.Scale.IsVisible = False
myPaneT.XAxis.Scale.Min = 0
myPaneT.XAxis.Scale.Max = (MeiSettings.WrkHrs * 60)
myPaneT.Legend.IsVisible = True
myPaneT.Border.IsVisible = False
myPaneT.Title.IsVisible = False
myPaneT.XAxis.MajorTic.IsOutside = False
myPaneT.XAxis.MinorTic.IsOutside = False
myPaneT.XAxis.MajorGrid.IsVisible = True
myPaneT.XAxis.MinorGrid.IsVisible = True
myPaneT.Margin.All = 1
If count = lbMach.Items.Count - 1 Then
myPaneT.XAxis.Title.IsVisible = True
myPaneT.XAxis.Scale.IsVisible = True
myPaneT.Margin.Bottom = 10
End If
If count > 0 Then
myPaneT.YAxis.Scale.IsSkipLastLabel = True
End If
myPaneT.YAxis.MinSpace = 20
myPaneT.Y2Axis.MinSpace = 20
Dim dt As DataTable = ItemsByMachineDT(mach, dat)
Dim myCurve As BarItem
If dt.Rows.Count > 0 Then
Dim profName As String = Nothing
Dim timeDur() As Double
For Each dr As DataRow In dt.Rows
If profName = dr("PRO").ToString() Then
timeDur = {((Convert.ToDouble(dr("QTY")) / Convert.ToDouble(dr("MPM"))))}
Else
timeDur = {((Convert.ToDouble(dr("QTY")) / Convert.ToDouble(dr("MPM")) + Convert.ToDouble(dr("Time"))))}
End If
myCurve = myPaneT.AddBar(dr("JOB").ToString & " - " & dr("PRO").ToString(), timeDur, Nothing, BarColor(rowCount))
If MeiSettings.IsGradient = True Then
myCurve.Bar.Fill = New Fill(BarColor(rowCount), Color.White, BarColor(rowCount), 90.0F)
Else
myCurve.Bar.Fill = New Fill(BarColor(rowCount), BarColor(rowCount), BarColor(rowCount), 90.0F)
End If
rowCount += 1
profName = dr("PRO").ToString()
Next
End If
myPaneT.YAxis.MajorTic.IsBetweenLabels = True
myPaneT.YAxis.Type = AxisType.Text
myPaneT.BarSettings.Type = BarType.Stack
myPaneT.BarSettings.Base = BarBase.Y
master.Add(myPaneT)
count += 1
Next
zgc.IsShowPointValues = True
Using g As Graphics = Me.CreateGraphics()
master.SetLayout(g, PaneLayout.SingleColumn)
master.AxisChange(g)
End Using
End Sub
to get control for each GraphPane :
GraphPane temp = zgc.MasterPane.PaneList.ElementAt(ind); //ind => index of the graphpane in zedgraphcontrol
to set static height n width ZedgraphControl :
zgc.Size = new Size(Width,Height);
to set visibility of scrollbar ZedgraphControl :
zgc.IsShowHScrollBar = true;
zgc.IsShowVScrollBar = true;