none
Con que puedo hacer al parecido a estas estadisticas RRS feed

Todas las respuestas

  • Hola:

     Algo completamente similar dudo que encuentres pero podrías acercartele si usas controles de terceros como:

     http://www.devcomponents.com/dotnetbar/

     https://www.syncfusion.com/products/windows-forms/grouping

        https://www.infragistics.com/products/windows-forms

      


    Saludos desde Monterrey, Nuevo León, México!!!

    • Propuesto como respuesta Pedro Ávila lunes, 7 de agosto de 2017 12:22
    lunes, 7 de agosto de 2017 0:25
  • En teoría se puede hacer, pero de allí a concatenar todos los datos hay mucha distancia

    Y muchos problemas que resolver, ej, para el caso utilizé Graphic y si minimiso se peirde el gráfico del picture que es la barra de lectura, eso para empezar luego quedaría todas las formulas, es buen desafío pero complicado

    Imports System.ComponentModel
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Graphics
    
    Public Class Form1
        Public alto As Integer = 0
        Public bajo As Integer = 0
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            medida.Refresh()
            medida.BackColor = SystemColors.Control
            Dim lap2 As Pen = New Pen(Brushes.Blue, 1)
            Dim i As Integer = 0
            For i = ValorBajo.Text To valorAlto.Text
                medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
            Next
            alto = i
            bajo = i
        End Sub
    
        Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    
            Dim graf As Graphics = Me.CreateGraphics()
            Dim a As New GraphicsPath()
            medida.BorderStyle = BorderStyle.Fixed3D
            medida.Location = New Point(270, 18)
            medida.Visible = True
            medida.Width = 25
            medida.Height = Me.Height - 76
    
            Dim i As Integer = 20
            Dim d As Integer = 10
            Dim b As Double = 1096
            Dim j As Integer = 0
            Dim lap As Pen = New Pen(Brushes.Red)
    
            For i = 20 To Me.Height - 79
    
                graf.DrawLine(lap, 235, i, 325, i)
                graf.DrawLine(lap, 255, i + 15, 310, i + 15)
                graf.DrawLine(lap, 255, i + 30, 310, i + 30)
                Dim lab As New Label
                lab.Name = j
                lab.Text = b
                lab.Width = 31
                lab.Height = 14
                lab.Location = New Point(230, i + 1)
                Me.Controls.Add(lab)
                i += 43
                d += 10
                b -= 8
                j += 1
            Next
            Bar1.Location = New Point(medida.Location.X + 50, medida.Location.Y)
            Bar1.Height = Me.Height - 76
    
    
    
        End Sub
    
    
    
        Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            If Me.WindowState = FormWindowState.Normal Then
                Dim lap2 As Pen = New Pen(Brushes.Blue, 1)
                For i As Integer = bajo To alto
                    medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                Next
            End If
        End Sub
    End Class



    • Editado Marcelo PF lunes, 7 de agosto de 2017 7:48
    lunes, 7 de agosto de 2017 7:34
  • estoy intentando meterlo en una clase y me lansa este error

    Imports System.ComponentModel
    
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Graphics
    
    Public Class Estadistica
        
        Inherits Control
        Public alto As Integer = 0
        Public bajo As Integer = 0
        Private Sub Estadistica_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim graf As Graphics = Me.CreateGraphics()
            Dim a As New GraphicsPath()
            medida2.BorderStyle = BorderStyle.Fixed3D
            medida2.Location = New Point(270, 18)
            medida2.Visible = True
            medida2.Width = 10
            medida2.Height = Me.Height - 76
    
            Dim i As Integer = 20
            Dim d As Integer = 10
            Dim b As Double = 1096
            Dim j As Integer = 0
            Dim lap As Pen = New Pen(Brushes.Red)
    
            For i = 20 To Me.Height - 79
    
                graf.DrawLine(lap, 235, i, 325, i)
                graf.DrawLine(lap, 255, i + 15, 310, i + 15)
                graf.DrawLine(lap, 255, i + 30, 310, i + 30)
                Dim lab As New Label
                lab.Name = j
                lab.Text = b
                lab.Width = 31
                lab.Height = 14
                lab.Location = New Point(230, i + 1)
                Me.Controls.Add(lab)
                i += 43
                d += 10
                b -= 8
                j += 1
            Next
            Bar2.Location = New Point(medida2.Location.X + 50, medida2.Location.Y)
            Bar2.Height = Me.Height - 76
        End Sub
      
        Friend WithEvents medida2 As System.Windows.Forms.PictureBox
        Friend WithEvents Bar2 As System.Windows.Forms.TrackBar
        
    
        
    
        Private Sub InitializeComponent()
            Me.medida2 = New System.Windows.Forms.PictureBox()
            Me.Bar2 = New System.Windows.Forms.TrackBar()
            CType(Me.medida2, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.Bar2, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'medida2
            '
            Me.medida2.Location = New System.Drawing.Point(0, 0)
            Me.medida2.Name = "medida2"
            Me.medida2.Size = New System.Drawing.Size(100, 50)
            Me.medida2.TabIndex = 0
            Me.medida2.TabStop = False
            '
            'Bar2
            '
            Me.Bar2.Location = New System.Drawing.Point(0, 0)
            Me.Bar2.Name = "Bar2"
            Me.Bar2.Size = New System.Drawing.Size(104, 45)
            Me.Bar2.TabIndex = 0
            CType(Me.medida2, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.Bar2, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
    
        End Su 
    


    • Editado JETET lunes, 7 de agosto de 2017 15:52
    lunes, 7 de agosto de 2017 15:32
  • hola JETET, Medida es un Picturebox, "barra de medidas" Bar1 es un TrakBar, dos textbox y un button, la barra Azul y las lineas de medida son graficos.

     Por si te sivre, entre número y número hay 44 pixeles, o se con una línea valor 1 colocas 44 lineas entre número y número

     Saludos


    • Editado Marcelo PF lunes, 7 de agosto de 2017 16:19
    lunes, 7 de agosto de 2017 16:17
  • Creo que no agregas al formulario me.Controls.Add(medida2)
    lunes, 7 de agosto de 2017 16:28
  • Si, ya copie el código, también debes agregar bar2 al control, y a mi me daba error en Inherits, lo quité y el Bar2 tienes que colocar Orientation = vertical, autosize = false, Tickfrequensy = 1, LargeChanged = 1,  Maximun = 500, TickStyle = TopLeft

    Lo sigo viendo

    Saludos



    • Editado Marcelo PF martes, 8 de agosto de 2017 6:40
    lunes, 7 de agosto de 2017 16:53
  • me sigue dando este error no puedo crear un componete nuevo 

    Imports System.ComponentModel
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Graphics
    
    Public Class CoolTrackBar
        Inherits Form
        Public alto As Integer = 0
        Public bajo As Integer = 0
    
        Friend WithEvents medida As System.Windows.Forms.PictureBox
        Friend WithEvents valorAlto As System.Windows.Forms.TextBox
        Friend WithEvents ValorBajo As System.Windows.Forms.TextBox
        Friend WithEvents Button1 As System.Windows.Forms.Button
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            medida.Refresh()
            medida.BackColor = SystemColors.Control
            Dim lap2 As Pen = New Pen(Brushes.LimeGreen, 1)
            Dim i As Integer = 0
            For i = ValorBajo.Text To valorAlto.Text
                medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
            Next
            alto = i
            bajo = i
        End Sub
        Private Sub InitializeComponent()
            Me.Button1 = New System.Windows.Forms.Button()
            Me.ValorBajo = New System.Windows.Forms.TextBox()
            Me.valorAlto = New System.Windows.Forms.TextBox()
            Me.medida = New System.Windows.Forms.PictureBox()
            CType(Me.medida, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'Button1
            '
            Me.Button1.Location = New System.Drawing.Point(31, 48)
            Me.Button1.Name = "Button1"
            Me.Button1.Size = New System.Drawing.Size(75, 23)
            Me.Button1.TabIndex = 0
            Me.Button1.Text = "Button1"
            Me.Button1.UseVisualStyleBackColor = True
            '
            'ValorBajo
            '
            Me.ValorBajo.Location = New System.Drawing.Point(59, 136)
            Me.ValorBajo.Name = "ValorBajo"
            Me.ValorBajo.Size = New System.Drawing.Size(100, 20)
            Me.ValorBajo.TabIndex = 1
            '
            'valorAlto
            '
            Me.valorAlto.Location = New System.Drawing.Point(59, 191)
            Me.valorAlto.Name = "valorAlto"
            Me.valorAlto.Size = New System.Drawing.Size(100, 20)
            Me.valorAlto.TabIndex = 2
            '
            'medida
            '
            Me.medida.Location = New System.Drawing.Point(208, 31)
            Me.medida.Name = "medida"
            Me.medida.Size = New System.Drawing.Size(109, 382)
            Me.medida.TabIndex = 3
            Me.medida.TabStop = False
            '
            'CoolTrackBar
            '
            Me.ClientSize = New System.Drawing.Size(507, 492)
            Me.Controls.Add(Me.medida)
            Me.Controls.Add(Me.valorAlto)
            Me.Controls.Add(Me.ValorBajo)
            Me.Controls.Add(Me.Button1)
            Me.Name = "CoolTrackBar"
            CType(Me.medida, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
            Me.PerformLayout()
    
        End Sub
    
        Private Sub CoolTrackBar_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim graf As Graphics = Me.CreateGraphics()
            Dim a As New GraphicsPath()
            medida.BorderStyle = BorderStyle.Fixed3D
            medida.Location = New Point(270, 18)
            medida.Visible = True
            medida.Width = 10
            medida.Height = Me.Height - 76
    
            Dim i As Integer = 20
            Dim d As Integer = 10
            Dim b As Double = 1096
            Dim j As Integer = 0
            Dim lap As Pen = New Pen(Brushes.Red)
    
            For i = 20 To Me.Height - 79
    
                graf.DrawLine(lap, 235, i, 325, i)
                graf.DrawLine(lap, 255, i + 15, 310, i + 15)
                graf.DrawLine(lap, 255, i + 30, 310, i + 30)
                Dim lab As New Label
                lab.Name = j
                lab.Text = b
                lab.Width = 31
                lab.Height = 14
                lab.Location = New Point(230, i + 1)
                Me.Controls.Add(lab)
                i += 43
                d += 10
                b -= 8
                j += 1
            Next
            Bar1.Location = New Point(medida.Location.X + 50, medida.Location.Y)
            Bar1.Height = Me.Height - 76
        End Sub
    
        Private Sub CoolTrackBar_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            If Me.WindowState = FormWindowState.Normal Then
                Dim lap2 As Pen = New Pen(Brushes.LimeGreen, 1)
                For i As Integer = bajo To alto
                    medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                Next
            End If
        End Sub
    End Class


    • Editado JETET martes, 8 de agosto de 2017 7:51
    martes, 8 de agosto de 2017 7:50
  • el Problema no es ese Marcelo y gracias por responder

    el problema es que no puedo hacer un componente nuevo

    le estoy dando vueltas pero no consigo nada de nada

    Gracias

    miércoles, 9 de agosto de 2017 7:32
  • Hola, yo logré hacer los seis componentes si a eso te refieres, ahora no estoy en casa para mostrarte, pero me tope con otros problemas, los graficos a medida que los cargo en los diferentes compo. se relentiza demasiado, para eso los introduje en un Panel y mejoro muy bien..pero, ahora me daba muy lento para cargar los label. Hasta allí llegué si quieres luego te muestro

    Saludos

    miércoles, 9 de agosto de 2017 8:22
  • ok, gracias

    miércoles, 9 de agosto de 2017 9:48
  • Bueno allí te dejo a ver si logras solucionar la relentización con los labels, ahora lo porbé en un grup pero igual es lento tarda aprox 1 minuto en cargar, sigo viendo. El tamaño del form debe ser igual desde el diseño si no genera un salto por el size

    Imports System.ComponentModel
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Graphics
    
    Public Class Form1
        Public alto As Integer = 0
        Public bajo As Integer = 0
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    
    
    
            Dim i As Integer = 0
            Select Case True
                Case CheckBox1.Checked
                    medida.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.Blue, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
    
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
    
                Case CheckBox2.Checked
                    medida1.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.Brown, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida1.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
                Case CheckBox3.Checked
                    medida2.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.DarkGray, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida2.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
                Case CheckBox4.Checked
                    medida3.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.Red, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida3.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
                Case CheckBox5.Checked
                    medida4.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.Magenta, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida4.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
                Case CheckBox6.Checked
                    medida5.Refresh()
    
                    Dim lap2 As Pen = New Pen(Brushes.BlueViolet, 1)
                    For i = valorBajo.Text To ValorAlto.Text
                        medida5.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                    Next
                    alto = i
                    bajo = i
                    lap2.Dispose()
            End Select
    
        End Sub
    
    
    
    
        Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            If Me.WindowState = FormWindowState.Normal Then
                Dim lap2 As Pen = New Pen(Brushes.Blue, 4)
                For i As Integer = bajo To alto
                    medida.CreateGraphics.DrawLine(lap2, 0, i, 0 + 25, i)
                Next
                lap2.Dispose()
            End If
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
        End Sub
    
    
        Private Sub Grp_Paint(sender As Object, e As PaintEventArgs) Handles Grp.Paint
            Dim graf As Graphics = Me.CreateGraphics()
    
            medida.BorderStyle = BorderStyle.Fixed3D
            medida.Location = New Point(270, 18)
            medida.Visible = True
            medida.Width = 25
            medida.Height = Grp.Height - 76
    
            Dim i As Integer = 20
            Dim d As Integer = 10
            Dim b As Double = 1096
            Dim j As Integer = 0
            Dim lap As Pen = New Pen(Brushes.Red)
    
            Dim sep As Integer = 0
            Dim dist As Integer = 270
            Dim pt0 As Integer = 235
            Dim pt1 As Integer = 325
            Dim pt2 As Integer = 255
            Dim pt3 As Integer = 310
    
            For sep = 0 To 5
                For i = 20 To Grp.Height - 79
    
                    Grp.CreateGraphics.DrawLine(lap, pt0, i, pt1, i)
                    Grp.CreateGraphics.DrawLine(lap, pt2, i + 15, pt3, i + 15)
                    Grp.CreateGraphics.DrawLine(lap, pt2, i + 30, pt3, i + 30)
                    Dim lab As New Label
    
                    lab.Name = j
                    lab.Text = b
                    lab.Width = 31
                    lab.Height = 14
                    lab.Location = New Point(pt0 - 5, i + 1)
                    Grp.Controls.Add(lab)
                    i += 43
                    d += 10
                    b -= 8
                    j += 1
    
                Next
    
                i = 20
    
                dist += 140
                pt0 = dist - 35
                pt1 = dist + 55
                pt2 = dist - 15
                pt3 = dist + 40
    
    
                If sep = 0 Then
                    medida1.Location = New Point(dist, 18)
                    medida1.BorderStyle = BorderStyle.Fixed3D
                    medida1.Visible = True
                    medida1.Width = 25
                    medida1.Height = Grp.Height - 76
    
                Else
                    If sep = 1 Then
                        medida2.Location = New Point(dist, 18)
                        medida2.BorderStyle = BorderStyle.Fixed3D
                        medida2.Visible = True
                        medida2.Width = 25
                        medida2.Height = Grp.Height - 76
                    Else
                        If sep = 2 Then
                            medida3.Location = New Point(dist, 18)
                            medida3.BorderStyle = BorderStyle.Fixed3D
                            medida3.Visible = True
                            medida3.Width = 25
                            medida3.Height = Grp.Height - 76
                        Else
                            If sep = 3 Then
                                medida4.Location = New Point(dist, 18)
                                medida4.BorderStyle = BorderStyle.Fixed3D
                                medida4.Visible = True
                                medida4.Width = 25
                                medida4.Height = Grp.Height - 76
                            Else
                                If sep = 4 Then
                                    medida5.Location = New Point(dist, 18)
                                    medida5.BorderStyle = BorderStyle.Fixed3D
                                    medida5.Visible = True
                                    medida5.Width = 25
                                    medida5.Height = Grp.Height - 76
    
    
                                End If
                            End If
    
                        End If
    
                    End If
    
                End If
            Next
            graf.Dispose()
            lap.Dispose()
    
    
            Dim bar0 As New TrackBar
            With bar0
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia1"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida.Location.X + 50, medida.Location.Y - 10)
            End With
            Grp.Controls.Add(bar0)
    
            Dim bar1 As New TrackBar
            With bar1
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia2"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida1.Location.X + 50, medida1.Location.Y - 10)
            End With
            Grp.Controls.Add(bar1)
    
            Dim bar2 As New TrackBar
            With bar2
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia3"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida2.Location.X + 50, medida2.Location.Y - 10)
            End With
            Grp.Controls.Add(bar2)
    
            Dim bar3 As New TrackBar
            With bar3
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia4"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida3.Location.X + 50, medida3.Location.Y - 10)
            End With
            Grp.Controls.Add(bar3)
    
            Dim bar4 As New TrackBar
            With bar4
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia5"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida4.Location.X + 50, medida4.Location.Y - 10)
            End With
            Grp.Controls.Add(bar4)
    
            Dim bar5 As New TrackBar
            With bar5
                .BackColor = Color.AntiqueWhite
                .Name = "tendencia6"
                .Height = Grp.Height - 53
                .Maximum = 500
                .Orientation = Orientation.Vertical
                .RightToLeftLayout = False
                .TickFrequency = 1
                .TickStyle = TickStyle.TopLeft
                .Visible = True
                .Location = New Point(medida5.Location.X + 50, medida5.Location.Y - 10)
            End With
            Grp.Controls.Add(bar5)
        End Sub

    Me avizas si logras abanzar en la carga

    Son 6 picture dentro del  Grup, el GrupBox, los check  para cargar cada módulo, dos textbox y un button lo demás lo genera en tiempo de ejecución.

    Saludos amigo


    • Editado Marcelo PF miércoles, 9 de agosto de 2017 11:08
    miércoles, 9 de agosto de 2017 11:03
  • Gracias Por Responder, dando un vistazo esta muy chulo pero sigues sin entender mi problema 

    el problema que tengo es que no puedo crear una class para hacer con el primero que mandastes un componente nuevo 

    no se si me he explicado

    Muchisimas gracias

    miércoles, 9 de agosto de 2017 11:48