Hirdetés
- Milyen TV-t vegyek?
- Ami Kínában OnePlus Pad Pro, az errefelé mégis csak Pad 2 lett
- Intel Core Ultra 3, Core Ultra 5, Ultra 7, Ultra 9 "Arrow Lake" LGA 1851
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Home server / házi szerver építése
- Fali konzol lapos tévékhez
- TCL LCD és LED TV-k
- Amlogic S905, S912 processzoros készülékek
- Fujifilm X
-
PROHARDVER!
A Microsoft Excel topic célja segítséget kérni és nyújtani Excellel kapcsolatos problémákra.
Kérdés felvetése előtt olvasd el, ha még nem tetted.
Új hozzászólás Aktív témák
-
VANESSZA1
őstag
Ezt a makró diagrammot hogyan tudom egy Excel táblába betenni?
Private addDataRunner As Thread
Private rand As New Random()
Private chart1 As Dundas.Charting.WinControl.Chart
Public Delegate Sub AddDataDelegate()
Public addDataDel As AddDataDelegate
...Private Sub RealTimeSample_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
Dim addDataThreadStart As New ThreadStart(AddressOf AddDataThreadLoop)
addDataRunner = New Thread(addDataThreadStart)addDataDel = New AddDataDelegate(AddressOf AddData)
End Sub 'RealTimeSample_Load
Private Sub startTrending_Click(sender As Object, e As System.EventArgs) Handles startTrending.Click
' Disable all controls on the form
startTrending.Enabled = False
' and only Enable the Stop button
stopTrending.Enabled = True' Predefine the viewing area of the chart
minValue = DateTime.Now
maxValue = minValue.AddSeconds(120)chart1.ChartAreas(0).AxisX.Minimum = minValue.ToOADate()
chart1.ChartAreas(0).AxisX.Maximum = maxValue.ToOADate()' Reset number of series in the chart.
chart1.Series.Clear()' create a line chart series
Dim newSeries As New Series("Series1")
newSeries.Type = SeriesChartType.Line
newSeries.BorderWidth = 2
newSeries.Color = Color.OrangeRed
newSeries.XValueType = ChartValueTypes.DateTime
chart1.Series.Add(newSeries)' start worker threads.
If addDataRunner.IsAlive = True Then
addDataRunner.Resume()
Else
addDataRunner.Start()
End If
End Sub 'startTrending_ClickPrivate Sub stopTrending_Click(sender As Object, e As System.EventArgs) Handles stopTrending.Click
If addDataRunner.IsAlive = True Then
addDataRunner.Suspend()
End If' Enable all controls on the form
startTrending.Enabled = True
' and only Disable the Stop button
stopTrending.Enabled = False
End Sub 'stopTrending_Click'/ Main loop for the thread that adds data to the chart.
'/ The main purpose of this function is to Invoke AddData
'/ function every 1000ms (1 second).
Private Sub AddDataThreadLoop()
While True
chart1.Invoke(addDataDel)Thread.Sleep(1000)
End While
End Sub 'AddDataThreadLoopPublic Sub AddData()
Dim timeStamp As DateTime = DateTime.NowDim ptSeries As Series
For Each ptSeries In chart1.Series
AddNewPoint(timeStamp, ptSeries)
Next ptSeries
End Sub 'AddData'/ The AddNewPoint function is called for each series in the chart when
'/ new points need to be added. The new point will be placed at specified
'/ X axis (Date/Time) position with a Y value in a range +/- 1 from the previous
'/ data point's Y value, and not smaller than zero.
Public Sub AddNewPoint(timeStamp As DateTime, ptSeries As Dundas.Charting.WinControl.Series)
Dim newVal As Double = 0If ptSeries.Points.Count > 0 Then
newVal = ptSeries.Points((ptSeries.Points.Count - 1)).YValues(0) +(rand.NextDouble() * 2 - 1)
End IfIf newVal < 0 Then
newVal = 0
End If
' Add new data point to its series.
ptSeries.Points.AddXY(timeStamp.ToOADate(), rand.Next(10, 20))' remove all points from the source series older than 1.5 minutes.
Dim removeBefore As Double = timeStamp.AddSeconds((CDbl(90) * - 1)).ToOADate()
'remove oldest values to maintain a constant number of data points
While ptSeries.Points(0).XValue < removeBefore
ptSeries.Points.RemoveAt(0)
End Whilechart1.ChartAreas(0).AxisX.Minimum = ptSeries.Points(0).XValue
chart1.ChartAreas(0).AxisX.Maximum = DateTime.FromOADate(ptSeries.Points(0).XValue).AddMinutes(2).ToOADate()chart1.Invalidate()
End Sub 'AddNewPoint'/ Clean up any resources being used.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If(addDataRunner.ThreadState And ThreadState.Suspended) = ThreadState.Suspended Then
addDataRunner.Resume()
End If
addDataRunner.Abort()If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub 'Dispose
Új hozzászólás Aktív témák
- Real Racing 3 - Freemium csoda
- Milyen TV-t vegyek?
- Milyen autót vegyek?
- LEGO klub
- Ami Kínában OnePlus Pad Pro, az errefelé mégis csak Pad 2 lett
- Windows 11
- Intel Core Ultra 3, Core Ultra 5, Ultra 7, Ultra 9 "Arrow Lake" LGA 1851
- Xiaomi 14T Pro - teljes a család?
- Debrecen és környéke adok-veszek-beszélgetek
- Trollok komolyan
- További aktív témák...
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Windows 10 11 Pro Office 19 21 Pro Plus Retail kulcs 1 PC Mac AKCIÓ! Automatikus 0-24
- Antivírus szoftverek, VPN
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Számlás!Steam,EA,Epic és egyébb játékok Pc-re vagy XBox!
- GYÖNYÖRŰ iPhone 13 Mini 128GB Blue- 1 ÉV GARANCIA -Kártyafüggetlen, MS4067,94% Akksi
- Apple iPhone 15 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
- Telefon felvásárlás!! iPhone 11/iPhone 11 Pro/iPhone 11 Pro Max
- Apple iPhone 16 Pro Max - Black Titanium - 256GB - Akku: 90% - Megkímélt állapot!
- AKCIÓ!!! HP ZBook Power 15 G8 Mobile Workstation i7-11850H 32GB 1000GB Nvidia RTX A2000
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Fferi50

