Imports FarPoint.Win
Imports FarPoint.Win.Spread
Imports System.Drawing
Imports System.Windows.Forms
Imports Spread.Common.Features.Spread.Common.Features.Sample

Namespace Features
    Partial Public Class GaugeKPISparkline
        Inherits BaseSampleControl

        Public Sub New()
            Me.InitializeComponent()
            Name = "Gauge KPI"
            InitControls()
            Me._fpSpread.ScrollBarTrackPolicy = ScrollBarTrackPolicy.Both
            Me.InitGaugeKPISparklineCircle(Me._fpSpread.Sheets(0))
            Me.InitGaugeKPISparklineVertical(Me._fpSpread.Sheets(1))
            Me.InitGaugeKPISparklineHorizontal(Me._fpSpread.Sheets(2))
        End Sub

#Region "Private Methods"
        Private Sub InitGaugeKPISparklineCircle(ByVal sheetView As SheetView)
            Dim worksheet As GrapeCity.Spreadsheet.IWorksheet = sheetView.AsWorksheet()
            worksheet.Name = "Circle"
            worksheet.SetValue(1, 0, New Object(,) {
            {"Teams", "Team A", "Team B", "Team C", "Team D", "Team E", "Team F"},
            {"Goal", 25000, 22000, 45000, 39000, 49000, 16000},
            {"Amount Raised", 24000, 23000, 45500, 29000, 49500, 25000},
            {"Diagram", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}})

            For i As Integer = 0 To 7 - 1
                worksheet.Columns($"{ChrW((i + 65))}").ColumnWidth = 300
            Next

            worksheet.Rows("5").RowHeight = 300
            worksheet.Rows("1").RowHeight = 35
            worksheet.Cells("A1:G1").Merge()
            worksheet.Cells("A1").Value = "Fundraising Teams KPI"
            worksheet.Cells("A1").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 15
            })
            worksheet.Cells("A1").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Center
            sheetView.Cells("A1").BackColor = Color.Gray
            sheetView.Cells("A1").ForeColor = Color.White
            worksheet.Cells("A2:A5").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 11,
                .Bold = True
            })
            worksheet.Cells("A2:A5").Borders.ApplyBorder(New GrapeCity.Spreadsheet.Border() With {
                .Right = New GrapeCity.Spreadsheet.BorderLine(GrapeCity.Spreadsheet.BorderLineStyle.Thin, GrapeCity.Spreadsheet.Color.FromKnownColor(GrapeCity.Core.KnownColor.Black))
            })
            worksheet.Cells("A2:A5").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Top
            worksheet.Cells("B2:G4").HorizontalAlignment = GrapeCity.Spreadsheet.HorizontalAlignment.Center
            worksheet.Cells("B3:G4").NumberFormat = "$0,K"
            worksheet.Cells("B5").Formula2 = "GAUGEKPISPARKLINE(B3,B4,0,50000,TRUE,TEXT(B3,""$0,K""),TEXT(B4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("C5").Formula2 = "GAUGEKPISPARKLINE(C3,C4,0,50000,TRUE,TEXT(C3,""$0,K""),TEXT(C4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D5").Formula2 = "GAUGEKPISPARKLINE(D3,D4,0,50000,TRUE,TEXT(D3,""$0,K""),TEXT(D4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("E5").Formula2 = "GAUGEKPISPARKLINE(E3,E4,0,50000,TRUE,TEXT(E3,""$0,K""),TEXT(E4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("F5").Formula2 = "GAUGEKPISPARKLINE(F3,F4,0,50000,TRUE,TEXT(F3,""$0,K""),TEXT(F4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("G5").Formula2 = "GAUGEKPISPARKLINE(G3,G4,0,50000,TRUE,TEXT(G3,""$0,K""),TEXT(G4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,-90,90,0.5,0,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
        End Sub

        Private Sub InitGaugeKPISparklineVertical(ByVal sheetView As SheetView)
            Dim worksheet As GrapeCity.Spreadsheet.IWorksheet = sheetView.AsWorksheet()
            worksheet.Name = "Vertical"
            worksheet.SetValue(1, 0, New Object(,) {
            {"Teams", "Team A", "Team B", "Team C", "Team D", "Team E", "Team F"},
            {"Goal", 25000, 22000, 45000, 39000, 49000, 16000},
            {"Amount Raised", 24000, 23000, 45500, 29000, 49500, 25000},
            {"Diagram", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}})

            For i As Integer = 0 To 7 - 1
                worksheet.Columns($"{ChrW((i + 65))}").ColumnWidth = 250
            Next

            worksheet.Rows("5").RowHeight = 300
            worksheet.Rows("1").RowHeight = 35
            worksheet.Cells("A1:G1").Merge()
            worksheet.Cells("A1").Value = "Fundraising Teams KPI"
            worksheet.Cells("A1").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 15
            })
            worksheet.Cells("A1").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Center
            sheetView.Cells("A1").BackColor = Color.Gray
            sheetView.Cells("A1").ForeColor = Color.White
            worksheet.Cells("A2:A5").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 11,
                .Bold = True
            })
            worksheet.Cells("A2:A5").Borders.ApplyBorder(New GrapeCity.Spreadsheet.Border() With {
                .Right = New GrapeCity.Spreadsheet.BorderLine(GrapeCity.Spreadsheet.BorderLineStyle.Thin, GrapeCity.Spreadsheet.Color.FromKnownColor(GrapeCity.Core.KnownColor.Black))
            })
            worksheet.Cells("A2:A5").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Top
            worksheet.Cells("B2:G4").HorizontalAlignment = GrapeCity.Spreadsheet.HorizontalAlignment.Center
            worksheet.Cells("B3:G4").NumberFormat = "$0,K"
            worksheet.Cells("B5").Formula2 = "GAUGEKPISPARKLINE(B3,B4,0,50000,TRUE,TEXT(B3,""$0,K""),TEXT(B4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("C5").Formula2 = "GAUGEKPISPARKLINE(C3,C4,0,50000,TRUE,TEXT(C3,""$0,K""),TEXT(C4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D5").Formula2 = "GAUGEKPISPARKLINE(D3,D4,0,50000,TRUE,TEXT(D3,""$0,K""),TEXT(D4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("E5").Formula2 = "GAUGEKPISPARKLINE(E3,E4,0,50000,TRUE,TEXT(E3,""$0,K""),TEXT(E4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("F5").Formula2 = "GAUGEKPISPARKLINE(F3,F4,0,50000,TRUE,TEXT(F3,""$0,K""),TEXT(F4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("G5").Formula2 = "GAUGEKPISPARKLINE(G3,G4,0,50000,TRUE,TEXT(G3,""$0,K""),TEXT(G4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,1,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
        End Sub

        Private Sub InitGaugeKPISparklineHorizontal(ByVal sheetView As SheetView)
            Dim worksheet As GrapeCity.Spreadsheet.IWorksheet = sheetView.AsWorksheet()
            worksheet.Name = "Horizontal"
            worksheet.SetValue(1, 0, New Object(,) {
            {"Teams", "Goal", "Amount Raised", "Diagram"},
            {"Team A", 25000, 24000, Nothing},
            {"Team B", 22000, 23000, Nothing},
            {"Team C", 45000, 45500, Nothing},
            {"Team D", 39000, 29000, Nothing},
            {"Team E", 49000, 49500, Nothing},
            {"Team F", 16000, 25000, Nothing}})

            For i As Integer = 0 To 3 - 1
                worksheet.Columns($"{ChrW((65 + i))}").ColumnWidth = 150
            Next

            worksheet.Rows("1").RowHeight = 35
            worksheet.Rows("2").RowHeight = 30

            For i As Integer = 2 To 8 - 1
                worksheet.Rows($"{i + 1}").RowHeight = 80
            Next

            worksheet.Columns("D").ColumnWidth = 260
            worksheet.Cells("A1:D1").Merge()
            worksheet.Cells("A1").Value = "Fundraising Teams KPI"
            worksheet.Cells("A1").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 15
            })
            worksheet.Cells("A1").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Center
            sheetView.Cells("A1").BackColor = Color.Gray
            sheetView.Cells("A1").ForeColor = Color.White
            worksheet.Cells("A2:D2").Font.ApplyFont(New GrapeCity.Spreadsheet.Font() With {
                .Name = "Arial",
                .Size = 11,
                .Bold = True
            })
            worksheet.Cells("A2:D2").Borders.ApplyBorder(New GrapeCity.Spreadsheet.Border() With {
                .Bottom = New GrapeCity.Spreadsheet.BorderLine(GrapeCity.Spreadsheet.BorderLineStyle.Thin, GrapeCity.Spreadsheet.Color.FromKnownColor(GrapeCity.Core.KnownColor.Black))
            })
            worksheet.Cells("A2:D2").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Top
            worksheet.Cells("B3:C8").HorizontalAlignment = GrapeCity.Spreadsheet.HorizontalAlignment.Center
            worksheet.Cells("A2:D8").VerticalAlignment = GrapeCity.Spreadsheet.VerticalAlignment.Center
            worksheet.Cells("B3:C8").NumberFormat = "$0,K"
            worksheet.Cells("D3").Formula2 = "GAUGEKPISPARKLINE(B3,C3,0,50000,TRUE,TEXT(B3,""$0,K""),TEXT(C3,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D4").Formula2 = "GAUGEKPISPARKLINE(B4,C4,0,50000,TRUE,TEXT(B4,""$0,K""),TEXT(C4,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D5").Formula2 = "GAUGEKPISPARKLINE(B5,C5,0,50000,TRUE,TEXT(B5,""$0,K""),TEXT(C5,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D6").Formula2 = "GAUGEKPISPARKLINE(B6,C6,0,50000,TRUE,TEXT(B6,""$0,K""),TEXT(C6,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D7").Formula2 = "GAUGEKPISPARKLINE(B7,C7,0,50000,TRUE,TEXT(B7,""$0,K""),TEXT(C7,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
            worksheet.Cells("D8").Formula2 = "GAUGEKPISPARKLINE(B8,C8,0,50000,TRUE,TEXT(B8,""$0,K""),TEXT(C8,""$0,K""),TEXT(0,""$0,K""),TEXT(50000,""$0,K""),,0,0,0,2,{0,10000,""#F7A711""},{10000,25000,""#BBBBBB""},{25000,50000,""#82BC00""})"
        End Sub

        Private Sub ApplyChanges()
            Dim worksheet As GrapeCity.Spreadsheet.IWorksheet = _fpSpread.ActiveSheet.AsWorksheet()
            Dim gaugeType As Integer = _fpSpread.ActiveSheetIndex
            Dim start As Integer = 1, [end] As Integer = 7

            If gaugeType = 2 Then
                start = 2
                [end] = 8
            End If

            For i As Integer = start To [end] - 1
                Dim goalcolumn = Convert.ToChar(65 + i) & "3"
                Dim actualcolumn = Convert.ToChar(65 + i) & "4"
                Dim row As Integer = 4
                Dim column As Integer = i

                If gaugeType = 2 Then
                    goalcolumn = "B" & (i + 1)
                    actualcolumn = "C" & (i + 1)
                    row = i
                    column = 3
                End If

                worksheet.Cells($"{ChrW((column + 65))}{row + 1}").Formula2 = $"GAUGEKPISPARKLINE({goalcolumn}, {actualcolumn}, {_txtMin.Text}, {_txtMax.Text},TRUE,TEXT({goalcolumn},""$0,K""),TEXT({actualcolumn},""$0,K"")," &
                    $"TEXT({_txtMin.Text},""$0,K""),TEXT({_txtMax.Text},""$0,K""),,-90,90,0.5,{gaugeType}," & $"{{ {_txtRng1Start.Text}, {_txtRng1End.Text},""{_cmbRng1Color.SelectedItem}"" }}," & $"{{{_txtRng2Start.Text},{_txtRng2End.Text},""{_cmbRng2Color.SelectedItem}"" }}," & $"{{{_txtRng3Start.Text},{_txtRng3End.Text},""{_cmbRng3Color.SelectedItem}"" }})"
            Next
        End Sub

        Private Sub InitControls()
            Me._cmbRng1Color.DropDownStyle = ComboBoxStyle.DropDownList
            Me._cmbRng2Color.DropDownStyle = ComboBoxStyle.DropDownList
            Me._cmbRng3Color.DropDownStyle = ComboBoxStyle.DropDownList
            Me._cmbRng1Color.DataSource = New String() {"White", "Black", "Orange", "LightGray", "Gray", "DarkGray", "Green"}
            Me._cmbRng2Color.DataSource = New String() {"White", "Black", "Orange", "LightGray", "Gray", "DarkGray", "Green"}
            Me._cmbRng3Color.DataSource = New String() {"White", "Black", "Orange", "LightGray", "Gray", "DarkGray", "Green"}
            Me._cmbRng1Color.SelectedIndex = 2
            Me._cmbRng2Color.SelectedIndex = 4
            Me._cmbRng3Color.SelectedIndex = 6
            Me._txtMin.Text = "0"
            Me._txtMax.Text = "50000"
            Me._txtRng1Start.Text = "0"
            Me._txtRng1End.Text = "10000"
            Me._txtRng2Start.Text = "10000"
            Me._txtRng2End.Text = "25000"
            Me._txtRng3Start.Text = "25000"
            Me._txtRng3End.Text = "50000"
            AddHandler Me._txtMin.LostFocus, AddressOf Me.OnMinLostFocus
            AddHandler Me._txtMax.LostFocus, AddressOf Me.OnMaxLostFocus
            AddHandler Me._txtRng1End.LostFocus, AddressOf Me.OnRange1EndValueLostFocus
            AddHandler Me._txtRng2End.LostFocus, AddressOf Me.OnRange2EndValueLostFocus
            AddHandler Me._cmbRng1Color.SelectedIndexChanged, AddressOf Me.OnComboBoxSelectionChanged
            AddHandler Me._cmbRng2Color.SelectedIndexChanged, AddressOf Me.OnComboBoxSelectionChanged
            AddHandler Me._cmbRng3Color.SelectedIndexChanged, AddressOf Me.OnComboBoxSelectionChanged
        End Sub
#End Region

#Region "Event Handlers"
        Private Sub OnMaxLostFocus(ByVal sender As Object, ByVal e As EventArgs)
            Dim result As Double = Nothing

            If Double.TryParse(Me._txtMax.Text, result) Then
                Me._txtRng3End.Text = result.ToString()
                ApplyChanges()
            End If
        End Sub

        Private Sub OnRange2EndValueLostFocus(ByVal sender As Object, ByVal e As EventArgs)
            Dim result As Double = Nothing

            If Double.TryParse(Me._txtRng2End.Text, result) Then
                Me._txtRng3Start.Text = result.ToString()
                ApplyChanges()
            End If
        End Sub

        Private Sub OnRange1EndValueLostFocus(ByVal sender As Object, ByVal e As EventArgs)
            Dim result As Double = Nothing

            If Double.TryParse(Me._txtRng1End.Text, result) Then
                Me._txtRng2Start.Text = result.ToString()
                ApplyChanges()
            End If
        End Sub

        Private Sub OnMinLostFocus(ByVal sender As Object, ByVal e As EventArgs)
            Dim result As Double = Nothing

            If Double.TryParse(Me._txtMin.Text, result) Then
                Me._txtRng1Start.Text = result.ToString()
                ApplyChanges()
            End If
        End Sub

        Private Sub OnComboBoxSelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
            ApplyChanges()
        End Sub

        Private Class CSharpImpl
            <Obsolete("Please refactor calling code to use normal Visual Basic assignment")>
            Shared Function __Assign(Of T)(ByRef target As T, value As T) As T
                target = value
                Return value
            End Function
        End Class
#End Region
    End Class
End Namespace


'
'GaugeKPISparkline.Designer.vb
'


Namespace Features
    Partial Class GaugeKPISparkline
        ''' <summary> 
        ''' Required designer variable.
        ''' </summary>
        Private components As ComponentModel.IContainer = Nothing

        ''' <summary> 
        ''' Clean up any resources being used.
        ''' </summary>
        ''' <paramname="disposing">true if managed resources should be disposed; otherwise, false.</param>
        Protected Overloads Sub Dispose(ByVal disposing As Boolean)
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If

            MyBase.Dispose(disposing)
        End Sub

#Region "Component Designer generated code"

        ''' <summary> 
        ''' Required method for Designer support - do not modify 
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As ComponentModel.ComponentResourceManager = New ComponentModel.ComponentResourceManager(GetType(GaugeKPISparkline))
            _fpSpread = New FarPoint.Win.Spread.FpSpread(FarPoint.Win.Spread.LegacyBehaviors.None, resources.GetObject("resource1"))
            _fpSpread_Sheet1 = _fpSpread.GetSheet(0)
            _fpSpread_Sheet2 = _fpSpread.GetSheet(1)
            _fpSpread_Sheet3 = _fpSpread.GetSheet(2)
            label1 = New System.Windows.Forms.Label()
            seperator = New System.Windows.Forms.Label()
            label3 = New System.Windows.Forms.Label()
            label4 = New System.Windows.Forms.Label()
            label2 = New System.Windows.Forms.Label()
            label5 = New System.Windows.Forms.Label()
            label6 = New System.Windows.Forms.Label()
            label7 = New System.Windows.Forms.Label()
            label8 = New System.Windows.Forms.Label()
            label9 = New System.Windows.Forms.Label()
            label10 = New System.Windows.Forms.Label()
            label11 = New System.Windows.Forms.Label()
            label12 = New System.Windows.Forms.Label()
            label13 = New System.Windows.Forms.Label()
            label14 = New System.Windows.Forms.Label()
            label15 = New System.Windows.Forms.Label()
            label16 = New System.Windows.Forms.Label()
            label17 = New System.Windows.Forms.Label()
            label18 = New System.Windows.Forms.Label()
            _txtMin = New System.Windows.Forms.TextBox()
            _txtMax = New System.Windows.Forms.TextBox()
            _txtRng1Start = New System.Windows.Forms.TextBox()
            _txtRng1End = New System.Windows.Forms.TextBox()
            _txtRng2Start = New System.Windows.Forms.TextBox()
            _txtRng2End = New System.Windows.Forms.TextBox()
            _txtRng3Start = New System.Windows.Forms.TextBox()
            _txtRng3End = New System.Windows.Forms.TextBox()
            _cmbRng1Color = New System.Windows.Forms.ComboBox()
            _cmbRng2Color = New System.Windows.Forms.ComboBox()
            _cmbRng3Color = New System.Windows.Forms.ComboBox()
            Me.pnlMain.SuspendLayout()
            Me.pnlControls.SuspendLayout()
            CType(_fpSpread, ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            ' 
            ' pnlMain
            ' 
            Me.pnlMain.Controls.Add(_fpSpread)
            ' 
            ' pnlControls
            ' 
            Me.pnlControls.AutoScroll = True
            Me.pnlControls.Controls.Add(_cmbRng3Color)
            Me.pnlControls.Controls.Add(_cmbRng2Color)
            Me.pnlControls.Controls.Add(_cmbRng1Color)
            Me.pnlControls.Controls.Add(_txtRng3End)
            Me.pnlControls.Controls.Add(_txtRng3Start)
            Me.pnlControls.Controls.Add(_txtRng2End)
            Me.pnlControls.Controls.Add(_txtRng2Start)
            Me.pnlControls.Controls.Add(_txtRng1End)
            Me.pnlControls.Controls.Add(_txtRng1Start)
            Me.pnlControls.Controls.Add(_txtMax)
            Me.pnlControls.Controls.Add(_txtMin)
            Me.pnlControls.Controls.Add(label18)
            Me.pnlControls.Controls.Add(label17)
            Me.pnlControls.Controls.Add(label16)
            Me.pnlControls.Controls.Add(label15)
            Me.pnlControls.Controls.Add(label14)
            Me.pnlControls.Controls.Add(label13)
            Me.pnlControls.Controls.Add(label12)
            Me.pnlControls.Controls.Add(label11)
            Me.pnlControls.Controls.Add(label10)
            Me.pnlControls.Controls.Add(label9)
            Me.pnlControls.Controls.Add(label8)
            Me.pnlControls.Controls.Add(label7)
            Me.pnlControls.Controls.Add(label6)
            Me.pnlControls.Controls.Add(label5)
            Me.pnlControls.Controls.Add(label2)
            Me.pnlControls.Controls.Add(label4)
            Me.pnlControls.Controls.Add(label3)
            Me.pnlControls.Controls.Add(seperator)
            Me.pnlControls.Controls.Add(label1)
            ' 
            ' _fpSpread
            ' 
            _fpSpread.AccessibleDescription = "Book1, Sheet1, Row 0, Column 0"
            _fpSpread.Dock = System.Windows.Forms.DockStyle.Fill
            _fpSpread.Font = New Drawing.Font("Calibri", 11.0F)
            _fpSpread.Location = New Drawing.Point(0, 0)
            _fpSpread.Name = "_fpSpread"
            _fpSpread.Size = New Drawing.Size(477, 487)
            _fpSpread.TabIndex = 0
            ' 
            ' label1
            ' 
            label1.AutoSize = True
            label1.Location = New Drawing.Point(14, 18)
            label1.Name = "label1"
            label1.Size = New Drawing.Size(100, 13)
            label1.TabIndex = 0
            label1.Text = "Gauge KPI Settings"
            ' 
            ' seperator
            ' 
            seperator.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            seperator.BackColor = Drawing.Color.DimGray
            seperator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            seperator.Location = New Drawing.Point(17, 121)
            seperator.Name = "seperator"
            seperator.Size = New Drawing.Size(127, 2)
            seperator.TabIndex = 1
            ' 
            ' label3
            ' 
            label3.AutoSize = True
            label3.Font = New Drawing.Font("Microsoft Sans Serif", 8.25F, Drawing.FontStyle.Underline, Drawing.GraphicsUnit.Point, 0)
            label3.Location = New Drawing.Point(14, 61)
            label3.Name = "label3"
            label3.Size = New Drawing.Size(57, 13)
            label3.TabIndex = 2
            label3.Text = "Min Value:"
            ' 
            ' label4
            ' 
            label4.AutoSize = True
            label4.Font = New Drawing.Font("Microsoft Sans Serif", 8.25F, Drawing.FontStyle.Underline, Drawing.GraphicsUnit.Point, 0)
            label4.Location = New Drawing.Point(14, 92)
            label4.Name = "label4"
            label4.Size = New Drawing.Size(60, 13)
            label4.TabIndex = 3
            label4.Text = "Max Value:"
            ' 
            ' label2
            ' 
            label2.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            label2.BackColor = Drawing.Color.DimGray
            label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            label2.Location = New Drawing.Point(17, 41)
            label2.Name = "label2"
            label2.Size = New Drawing.Size(127, 2)
            label2.TabIndex = 4
            ' 
            ' label5
            ' 
            label5.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            label5.BackColor = Drawing.Color.DimGray
            label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            label5.Location = New Drawing.Point(17, 231)
            label5.Name = "label5"
            label5.Size = New Drawing.Size(127, 2)
            label5.TabIndex = 5
            ' 
            ' label6
            ' 
            label6.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            label6.BackColor = Drawing.Color.DimGray
            label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            label6.Location = New Drawing.Point(17, 354)
            label6.Name = "label6"
            label6.Size = New Drawing.Size(127, 2)
            label6.TabIndex = 6
            ' 
            ' label7
            ' 
            label7.AutoSize = True
            label7.Font = New Drawing.Font("Microsoft Sans Serif", 8.25F, Drawing.FontStyle.Underline, Drawing.GraphicsUnit.Point, 0)
            label7.Location = New Drawing.Point(14, 376)
            label7.Name = "label7"
            label7.Size = New Drawing.Size(48, 13)
            label7.TabIndex = 7
            label7.Text = "Range 3"
            ' 
            ' label8
            ' 
            label8.AutoSize = True
            label8.Font = New Drawing.Font("Microsoft Sans Serif", 8.25F, Drawing.FontStyle.Underline, Drawing.GraphicsUnit.Point, 0)
            label8.Location = New Drawing.Point(14, 132)
            label8.Name = "label8"
            label8.Size = New Drawing.Size(48, 13)
            label8.TabIndex = 8
            label8.Text = "Range 1"
            ' 
            ' label9
            ' 
            label9.AutoSize = True
            label9.Font = New Drawing.Font("Microsoft Sans Serif", 8.25F, Drawing.FontStyle.Underline, Drawing.GraphicsUnit.Point, 0)
            label9.Location = New Drawing.Point(14, 250)
            label9.Name = "label9"
            label9.Size = New Drawing.Size(48, 13)
            label9.TabIndex = 9
            label9.Text = "Range 2"
            ' 
            ' label10
            ' 
            label10.AutoSize = True
            label10.Location = New Drawing.Point(14, 156)
            label10.Name = "label10"
            label10.Size = New Drawing.Size(34, 13)
            label10.TabIndex = 10
            label10.Text = "Color:"
            ' 
            ' label11
            ' 
            label11.AutoSize = True
            label11.Location = New Drawing.Point(14, 179)
            label11.Name = "label11"
            label11.Size = New Drawing.Size(62, 13)
            label11.TabIndex = 11
            label11.Text = "Start Value:"
            ' 
            ' label12
            ' 
            label12.AutoSize = True
            label12.Location = New Drawing.Point(14, 203)
            label12.Name = "label12"
            label12.Size = New Drawing.Size(59, 13)
            label12.TabIndex = 12
            label12.Text = "End Value:"
            ' 
            ' label13
            ' 
            label13.AutoSize = True
            label13.Location = New Drawing.Point(14, 275)
            label13.Name = "label13"
            label13.Size = New Drawing.Size(34, 13)
            label13.TabIndex = 13
            label13.Text = "Color:"
            ' 
            ' label14
            ' 
            label14.AutoSize = True
            label14.Location = New Drawing.Point(14, 300)
            label14.Name = "label14"
            label14.Size = New Drawing.Size(62, 13)
            label14.TabIndex = 14
            label14.Text = "Start Value:"
            ' 
            ' label15
            ' 
            label15.AutoSize = True
            label15.Location = New Drawing.Point(14, 326)
            label15.Name = "label15"
            label15.Size = New Drawing.Size(59, 13)
            label15.TabIndex = 15
            label15.Text = "End Value:"
            ' 
            ' label16
            ' 
            label16.AutoSize = True
            label16.Location = New Drawing.Point(14, 404)
            label16.Name = "label16"
            label16.Size = New Drawing.Size(34, 13)
            label16.TabIndex = 16
            label16.Text = "Color:"
            ' 
            ' label17
            ' 
            label17.AutoSize = True
            label17.Location = New Drawing.Point(14, 429)
            label17.Name = "label17"
            label17.Size = New Drawing.Size(62, 13)
            label17.TabIndex = 17
            label17.Text = "Start Value:"
            ' 
            ' label18
            ' 
            label18.AutoSize = True
            label18.Location = New Drawing.Point(14, 453)
            label18.Name = "label18"
            label18.Size = New Drawing.Size(59, 13)
            label18.TabIndex = 18
            label18.Text = "End Value:"
            ' 
            ' _txtMin
            ' 
            _txtMin.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtMin.Location = New Drawing.Point(77, 58)
            _txtMin.Name = "_txtMin"
            _txtMin.Size = New Drawing.Size(56, 20)
            _txtMin.TabIndex = 19
            ' 
            ' _txtMax
            ' 
            _txtMax.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtMax.Location = New Drawing.Point(77, 89)
            _txtMax.Name = "_txtMax"
            _txtMax.Size = New Drawing.Size(56, 20)
            _txtMax.TabIndex = 20
            ' 
            ' _txtRng1Start
            ' 
            _txtRng1Start.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng1Start.Enabled = False
            _txtRng1Start.Location = New Drawing.Point(78, 176)
            _txtRng1Start.Name = "_txtRng1Start"
            _txtRng1Start.Size = New Drawing.Size(56, 20)
            _txtRng1Start.TabIndex = 21
            ' 
            ' _txtRng1End
            ' 
            _txtRng1End.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng1End.Location = New Drawing.Point(78, 200)
            _txtRng1End.Name = "_txtRng1End"
            _txtRng1End.Size = New Drawing.Size(56, 20)
            _txtRng1End.TabIndex = 22
            ' 
            ' _txtRng2Start
            ' 
            _txtRng2Start.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng2Start.Enabled = False
            _txtRng2Start.Location = New Drawing.Point(78, 297)
            _txtRng2Start.Name = "_txtRng2Start"
            _txtRng2Start.Size = New Drawing.Size(56, 20)
            _txtRng2Start.TabIndex = 23
            ' 
            ' _txtRng2End
            ' 
            _txtRng2End.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng2End.Location = New Drawing.Point(78, 323)
            _txtRng2End.Name = "_txtRng2End"
            _txtRng2End.Size = New Drawing.Size(56, 20)
            _txtRng2End.TabIndex = 24
            ' 
            ' _txtRng3Start
            ' 
            _txtRng3Start.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng3Start.Enabled = False
            _txtRng3Start.Location = New Drawing.Point(78, 426)
            _txtRng3Start.Name = "_txtRng3Start"
            _txtRng3Start.Size = New Drawing.Size(56, 20)
            _txtRng3Start.TabIndex = 25
            ' 
            ' _txtRng3End
            ' 
            _txtRng3End.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _txtRng3End.Enabled = False
            _txtRng3End.Location = New Drawing.Point(78, 450)
            _txtRng3End.Name = "_txtRng3End"
            _txtRng3End.Size = New Drawing.Size(56, 20)
            _txtRng3End.TabIndex = 26
            ' 
            ' _cmbRng1Color
            ' 
            _cmbRng1Color.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _cmbRng1Color.FormattingEnabled = True
            _cmbRng1Color.Location = New Drawing.Point(78, 149)
            _cmbRng1Color.Name = "_cmbRng1Color"
            _cmbRng1Color.Size = New Drawing.Size(55, 21)
            _cmbRng1Color.TabIndex = 27
            ' 
            ' _cmbRng2Color
            ' 
            _cmbRng2Color.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _cmbRng2Color.FormattingEnabled = True
            _cmbRng2Color.Location = New Drawing.Point(77, 272)
            _cmbRng2Color.Name = "_cmbRng2Color"
            _cmbRng2Color.Size = New Drawing.Size(56, 21)
            _cmbRng2Color.TabIndex = 28
            ' 
            ' _cmbRng3Color
            ' 
            _cmbRng3Color.Anchor = System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right
            _cmbRng3Color.FormattingEnabled = True
            _cmbRng3Color.Location = New Drawing.Point(77, 401)
            _cmbRng3Color.Name = "_cmbRng3Color"
            _cmbRng3Color.Size = New Drawing.Size(56, 21)
            _cmbRng3Color.TabIndex = 29
            ' 
            ' GaugeKPISparkline
            ' 
            Me.AutoScaleDimensions = New Drawing.SizeF(6.0F, 13.0F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.Name = "GaugeKPISparkline"
            Me.pnlMain.ResumeLayout(False)
            Me.pnlControls.ResumeLayout(False)
            Me.pnlControls.PerformLayout()
            CType(_fpSpread, ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
        End Sub

#End Region

        Private _fpSpread As FarPoint.Win.Spread.FpSpread
        Private _fpSpread_Sheet1 As FarPoint.Win.Spread.SheetView
        Private _fpSpread_Sheet2 As FarPoint.Win.Spread.SheetView
        Private _fpSpread_Sheet3 As FarPoint.Win.Spread.SheetView
        Private label4 As System.Windows.Forms.Label
        Private label3 As System.Windows.Forms.Label
        Private seperator As System.Windows.Forms.Label
        Private label1 As System.Windows.Forms.Label
        Private label6 As System.Windows.Forms.Label
        Private label5 As System.Windows.Forms.Label
        Private label2 As System.Windows.Forms.Label
        Private label9 As System.Windows.Forms.Label
        Private label8 As System.Windows.Forms.Label
        Private label7 As System.Windows.Forms.Label
        Private label12 As System.Windows.Forms.Label
        Private label11 As System.Windows.Forms.Label
        Private label10 As System.Windows.Forms.Label
        Private label15 As System.Windows.Forms.Label
        Private label14 As System.Windows.Forms.Label
        Private label13 As System.Windows.Forms.Label
        Private label18 As System.Windows.Forms.Label
        Private label17 As System.Windows.Forms.Label
        Private label16 As System.Windows.Forms.Label
        Private _txtMax As System.Windows.Forms.TextBox
        Private _txtMin As System.Windows.Forms.TextBox
        Private _txtRng1End As System.Windows.Forms.TextBox
        Private _txtRng1Start As System.Windows.Forms.TextBox
        Private _txtRng3End As System.Windows.Forms.TextBox
        Private _txtRng3Start As System.Windows.Forms.TextBox
        Private _txtRng2End As System.Windows.Forms.TextBox
        Private _txtRng2Start As System.Windows.Forms.TextBox
        Private _cmbRng3Color As System.Windows.Forms.ComboBox
        Private _cmbRng2Color As System.Windows.Forms.ComboBox
        Private _cmbRng1Color As System.Windows.Forms.ComboBox
    End Class
End Namespace
