...
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\libs\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
@@ -58,11 +60,14 @@
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="WindowsFormsIntegration" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
|
||||
63
DogeCharts/Form1.Designer.vb
generated
63
DogeCharts/Form1.Designer.vb
generated
@@ -22,83 +22,39 @@ Partial Class Form1
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Dim ChartArea1 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea()
|
||||
Dim Legend1 As System.Windows.Forms.DataVisualization.Charting.Legend = New System.Windows.Forms.DataVisualization.Charting.Legend()
|
||||
Dim Series1 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
|
||||
Me.tbCoinDataURL = New System.Windows.Forms.TextBox()
|
||||
Me.btnGetCoinData = New System.Windows.Forms.Button()
|
||||
Me.Chart1 = New System.Windows.Forms.DataVisualization.Charting.Chart()
|
||||
CType(Me.Chart1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'tbCoinDataURL
|
||||
'
|
||||
Me.tbCoinDataURL.Location = New System.Drawing.Point(12, 12)
|
||||
Me.tbCoinDataURL.Location = New System.Drawing.Point(18, 18)
|
||||
Me.tbCoinDataURL.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
|
||||
Me.tbCoinDataURL.Name = "tbCoinDataURL"
|
||||
Me.tbCoinDataURL.Size = New System.Drawing.Size(331, 20)
|
||||
Me.tbCoinDataURL.Size = New System.Drawing.Size(494, 26)
|
||||
Me.tbCoinDataURL.TabIndex = 0
|
||||
Me.tbCoinDataURL.Text = "https://www.hirnwun.de:4555/c/getCoinData.php"
|
||||
'
|
||||
'btnGetCoinData
|
||||
'
|
||||
Me.btnGetCoinData.Location = New System.Drawing.Point(349, 10)
|
||||
Me.btnGetCoinData.Location = New System.Drawing.Point(524, 15)
|
||||
Me.btnGetCoinData.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
|
||||
Me.btnGetCoinData.Name = "btnGetCoinData"
|
||||
Me.btnGetCoinData.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnGetCoinData.Size = New System.Drawing.Size(112, 35)
|
||||
Me.btnGetCoinData.TabIndex = 1
|
||||
Me.btnGetCoinData.Text = "get data"
|
||||
Me.btnGetCoinData.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Chart1
|
||||
'
|
||||
Me.Chart1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
ChartArea1.AxisX.Crossing = -1.7976931348623157E+308R
|
||||
ChartArea1.AxisX.IsLabelAutoFit = False
|
||||
ChartArea1.AxisX.LabelStyle.Angle = -65
|
||||
ChartArea1.AxisX.MinorTickMark.Enabled = True
|
||||
ChartArea1.AxisX.MinorTickMark.Interval = 1.0R
|
||||
ChartArea1.AxisX.MinorTickMark.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number
|
||||
ChartArea1.AxisX.MinorTickMark.TickMarkStyle = System.Windows.Forms.DataVisualization.Charting.TickMarkStyle.AcrossAxis
|
||||
ChartArea1.AxisX.ScaleBreakStyle.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet
|
||||
ChartArea1.AxisX.ScaleView.Zoomable = False
|
||||
ChartArea1.AxisY.Maximum = 1.0R
|
||||
ChartArea1.AxisY.Minimum = 0R
|
||||
ChartArea1.Name = "ChartArea1"
|
||||
Me.Chart1.ChartAreas.Add(ChartArea1)
|
||||
Legend1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Legend1.IsTextAutoFit = False
|
||||
Legend1.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Column
|
||||
Legend1.Name = "Legend1"
|
||||
Legend1.Position.Auto = False
|
||||
Legend1.Position.Height = 5.709625!
|
||||
Legend1.Position.Width = 10.40413!
|
||||
Legend1.Position.X = 86.59587!
|
||||
Legend1.Position.Y = 3.0!
|
||||
Me.Chart1.Legends.Add(Legend1)
|
||||
Me.Chart1.Location = New System.Drawing.Point(12, 39)
|
||||
Me.Chart1.Name = "Chart1"
|
||||
Series1.ChartArea = "ChartArea1"
|
||||
Series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
|
||||
Series1.CustomProperties = "LabelStyle=Right"
|
||||
Series1.Legend = "Legend1"
|
||||
Series1.Name = "DOGE"
|
||||
Me.Chart1.Series.Add(Series1)
|
||||
Me.Chart1.Size = New System.Drawing.Size(776, 399)
|
||||
Me.Chart1.TabIndex = 2
|
||||
Me.Chart1.Text = "Chart1"
|
||||
'
|
||||
'Form1
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Chart1)
|
||||
Me.ClientSize = New System.Drawing.Size(1032, 793)
|
||||
Me.Controls.Add(Me.btnGetCoinData)
|
||||
Me.Controls.Add(Me.tbCoinDataURL)
|
||||
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
|
||||
Me.Name = "Form1"
|
||||
Me.Text = "Form1"
|
||||
CType(Me.Chart1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@@ -106,5 +62,4 @@ Partial Class Form1
|
||||
|
||||
Friend WithEvents tbCoinDataURL As TextBox
|
||||
Friend WithEvents btnGetCoinData As Button
|
||||
Friend WithEvents Chart1 As DataVisualization.Charting.Chart
|
||||
End Class
|
||||
|
||||
@@ -2,25 +2,35 @@
|
||||
Imports System.IO
|
||||
Imports System.Collections.Generic
|
||||
Imports Newtonsoft.Json
|
||||
Imports ChartDirector
|
||||
|
||||
|
||||
Public Class Form1
|
||||
|
||||
Dim tblData As New DataTable
|
||||
Dim tblCreated As Boolean = False
|
||||
|
||||
Private Sub btnGetCoinData_Click(sender As Object, e As EventArgs) Handles btnGetCoinData.Click
|
||||
|
||||
If Not tblCreated Then
|
||||
tblData.Columns.Add("tStamp")
|
||||
tblData.Columns.Add("priceEUR")
|
||||
|
||||
Chart1.ChartAreas(0).AxisX.ScaleView.Zoomable = True
|
||||
Chart1.ChartAreas(0).AxisY.ScaleView.Zoomable = True
|
||||
tblData.Columns.Add("priceEURDoge")
|
||||
tblData.Columns.Add("priceEURBTT")
|
||||
tblCreated = True
|
||||
Else
|
||||
tblData.Clear()
|
||||
End If
|
||||
|
||||
|
||||
With Chart1.Series.Item(0)
|
||||
.LabelAngle = 90
|
||||
.MarkerStep = 5
|
||||
End With
|
||||
|
||||
'Chart1.ChartAreas(0).AxisX.ScaleView.Zoomable = True
|
||||
'Chart1.ChartAreas(0).AxisY.ScaleView.Zoomable = True
|
||||
|
||||
|
||||
'With Chart1.Series.Item(0)
|
||||
' .LabelAngle = 90
|
||||
' .MarkerStep = 5
|
||||
'End With
|
||||
|
||||
Dim drowCoindata As DataRow = tblData.NewRow
|
||||
Dim sRead As StreamReader
|
||||
@@ -34,15 +44,15 @@ Public Class Form1
|
||||
|
||||
For i As Int32 = 0 To lastelement
|
||||
|
||||
tblData.Rows.Add(jo(i)("tstamp"), jo(i)("bitpandaDOGE"))
|
||||
Chart1.Series.Item(0).Points.AddXY(CInt(jo(i)("tstamp")), CDbl(jo(i)("bitpandaDOGE")))
|
||||
tblData.Rows.Add(jo(i)("tstamp"), jo(i)("bitpandaDOGE"), jo(i)("bitpandaBTT"))
|
||||
|
||||
'Chart1.Series.Item(0).Points.AddXY(CInt(jo(i)("tstamp")), CDbl(jo(i)("bitpandaDOGE")))
|
||||
'Chart1.Series.Item(1).Points.AddXY(CInt(jo(i)("tstamp")), CDbl(jo(i)("bitpandaBTT")))
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Dim wReq As HttpWebRequest = DirectCast(WebRequest.Create(tbCoinDataURL.Text), HttpWebRequest)
|
||||
'Dim px As IWebProxy = WebRequest.GetSystemWebProxy()
|
||||
|
||||
@@ -53,74 +63,56 @@ Public Class Form1
|
||||
'Dim resp As HttpWebResponse = wReq.GetResponse
|
||||
|
||||
End Sub
|
||||
Dim numberOfZoom As Int32 = 0
|
||||
Private Sub Chart1_MouseWheel(sender As Object, e As MouseEventArgs) Handles Chart1.MouseWheel
|
||||
'Dim chart = Chart1
|
||||
'Dim xAxis = chart.ChartAreas(0).AxisX
|
||||
'Dim yAxis = chart.ChartAreas(0).AxisY
|
||||
|
||||
'Try
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
' If e.Delta < 0 Then
|
||||
' xAxis.ScaleView.ZoomReset()
|
||||
' yAxis.ScaleView.ZoomReset()
|
||||
' ElseIf e.Delta > 0 Then
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Dim numberOfZoom As Int32 = 0
|
||||
'Private Sub Chart1_MouseWheel(sender As Object, e As MouseEventArgs) Handles Chart1.MouseWheel
|
||||
' Dim chart = Chart1
|
||||
' Dim xAxis = chart.ChartAreas(0).AxisX
|
||||
' Dim yAxis = chart.ChartAreas(0).AxisY
|
||||
' Dim xMin = xAxis.ScaleView.ViewMinimum
|
||||
' Dim xMax = xAxis.ScaleView.ViewMaximum
|
||||
' Dim yMin = yAxis.ScaleView.ViewMinimum
|
||||
' Dim yMax = yAxis.ScaleView.ViewMaximum
|
||||
' Dim posXStart = xAxis.PixelPositionToValue(e.Location.X) - (xMax - xMin) / 4
|
||||
' Dim posXFinish = xAxis.PixelPositionToValue(e.Location.X) + (xMax - xMin) / 4
|
||||
' Dim posYStart = yAxis.PixelPositionToValue(e.Location.Y) - (yMax - yMin) / 4
|
||||
' Dim posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + (yMax - yMin) / 4
|
||||
' Dim IntervalX As Integer = 3
|
||||
' Dim IntervalY As Integer = 3
|
||||
|
||||
' Try
|
||||
|
||||
' If e.Delta < 0 AndAlso numberOfZoom > 0 Then
|
||||
' Dim posXStart = xAxis.PixelPositionToValue(e.Location.X) - IntervalX * 2 / Math.Pow(2, numberOfZoom)
|
||||
' Dim posXFinish = xAxis.PixelPositionToValue(e.Location.X) + IntervalX * 2 / Math.Pow(2, numberOfZoom)
|
||||
' Dim posYStart = yAxis.PixelPositionToValue(e.Location.Y) - IntervalY * 2 / Math.Pow(2, numberOfZoom)
|
||||
' Dim posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + IntervalY * 2 / Math.Pow(2, numberOfZoom)
|
||||
' If posXStart < 0 Then posXStart = 0
|
||||
' If posYStart < 0 Then posYStart = 0
|
||||
' If posYFinish > yAxis.Maximum Then posYFinish = yAxis.Maximum
|
||||
' If posXFinish > xAxis.Maximum Then posYFinish = xAxis.Maximum
|
||||
' xAxis.ScaleView.Zoom(posXStart, posXFinish)
|
||||
' 'yAxis.ScaleView.Zoom(posYStart, posYFinish)
|
||||
' numberOfZoom -= 1
|
||||
' ElseIf e.Delta < 0 AndAlso numberOfZoom = 0 Then
|
||||
' yAxis.ScaleView.ZoomReset()
|
||||
' xAxis.ScaleView.ZoomReset()
|
||||
' ElseIf e.Delta > 0 Then
|
||||
' Dim posXStart = xAxis.PixelPositionToValue(e.Location.X) - IntervalX / Math.Pow(2, numberOfZoom)
|
||||
' Dim posXFinish = xAxis.PixelPositionToValue(e.Location.X) + IntervalX / Math.Pow(2, numberOfZoom)
|
||||
' Dim posYStart = yAxis.PixelPositionToValue(e.Location.Y) - IntervalY / Math.Pow(2, numberOfZoom)
|
||||
' Dim posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + IntervalY / Math.Pow(2, numberOfZoom)
|
||||
' xAxis.ScaleView.Zoom(posXStart, posXFinish)
|
||||
' 'yAxis.ScaleView.Zoom(posYStart, posYFinish)
|
||||
' numberOfZoom += 1
|
||||
' End If
|
||||
|
||||
'Catch
|
||||
'End Try
|
||||
|
||||
Dim chart = Chart1
|
||||
Dim xAxis = chart.ChartAreas(0).AxisX
|
||||
Dim yAxis = chart.ChartAreas(0).AxisY
|
||||
Dim xMin = xAxis.ScaleView.ViewMinimum
|
||||
Dim xMax = xAxis.ScaleView.ViewMaximum
|
||||
Dim yMin = yAxis.ScaleView.ViewMinimum
|
||||
Dim yMax = yAxis.ScaleView.ViewMaximum
|
||||
Dim IntervalX As Integer = 3
|
||||
Dim IntervalY As Integer = 3
|
||||
|
||||
Try
|
||||
|
||||
If e.Delta < 0 AndAlso numberOfZoom > 0 Then
|
||||
Dim posXStart = xAxis.PixelPositionToValue(e.Location.X) - IntervalX * 2 / Math.Pow(2, numberOfZoom)
|
||||
Dim posXFinish = xAxis.PixelPositionToValue(e.Location.X) + IntervalX * 2 / Math.Pow(2, numberOfZoom)
|
||||
Dim posYStart = yAxis.PixelPositionToValue(e.Location.Y) - IntervalY * 2 / Math.Pow(2, numberOfZoom)
|
||||
Dim posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + IntervalY * 2 / Math.Pow(2, numberOfZoom)
|
||||
If posXStart < 0 Then posXStart = 0
|
||||
If posYStart < 0 Then posYStart = 0
|
||||
If posYFinish > yAxis.Maximum Then posYFinish = yAxis.Maximum
|
||||
If posXFinish > xAxis.Maximum Then posYFinish = xAxis.Maximum
|
||||
xAxis.ScaleView.Zoom(posXStart, posXFinish)
|
||||
'yAxis.ScaleView.Zoom(posYStart, posYFinish)
|
||||
numberOfZoom -= 1
|
||||
ElseIf e.Delta < 0 AndAlso numberOfZoom = 0 Then
|
||||
yAxis.ScaleView.ZoomReset()
|
||||
xAxis.ScaleView.ZoomReset()
|
||||
ElseIf e.Delta > 0 Then
|
||||
Dim posXStart = xAxis.PixelPositionToValue(e.Location.X) - IntervalX / Math.Pow(2, numberOfZoom)
|
||||
Dim posXFinish = xAxis.PixelPositionToValue(e.Location.X) + IntervalX / Math.Pow(2, numberOfZoom)
|
||||
Dim posYStart = yAxis.PixelPositionToValue(e.Location.Y) - IntervalY / Math.Pow(2, numberOfZoom)
|
||||
Dim posYFinish = yAxis.PixelPositionToValue(e.Location.Y) + IntervalY / Math.Pow(2, numberOfZoom)
|
||||
xAxis.ScaleView.Zoom(posXStart, posXFinish)
|
||||
'yAxis.ScaleView.Zoom(posYStart, posYFinish)
|
||||
numberOfZoom += 1
|
||||
End If
|
||||
|
||||
If numberOfZoom < 0 Then numberOfZoom = 0
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
' If numberOfZoom < 0 Then numberOfZoom = 0
|
||||
' Catch
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,75 +1,9 @@
|
||||
'Class Module1
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
|
||||
' ' Create a new request to the mentioned URL.
|
||||
' Dim myWebRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
|
||||
' Dim myProxy As New WebProxy()
|
||||
|
||||
' ' Obtain the Proxy Prperty of the Default browser.
|
||||
' myProxy = CType(myWebRequest.Proxy, WebProxy)
|
||||
|
||||
' ' Print myProxy address to the console.
|
||||
' Console.WriteLine(ControlChars.Cr + "The actual default Proxy settings are {0}", myProxy.Address)
|
||||
|
||||
' Try
|
||||
' Console.WriteLine(ControlChars.Cr + "Please enter the new Proxy Address to be set ")
|
||||
' Console.WriteLine("The format of the address should be http://proxyUriAddress:portaddress")
|
||||
' Console.WriteLine("Example:http://moon.proxy.com:8080")
|
||||
' Dim proxyAddress As String
|
||||
' proxyAddress = Console.ReadLine()
|
||||
|
||||
' If proxyAddress.Length = 0 Then
|
||||
' myWebRequest.Proxy = myProxy
|
||||
' Else
|
||||
' Console.WriteLine(ControlChars.Cr + "Please enter the Credentials")
|
||||
' Console.WriteLine("Username:")
|
||||
' Dim username As String
|
||||
' username = Console.ReadLine()
|
||||
' Console.WriteLine(ControlChars.Cr + "Password:")
|
||||
' Dim password As String
|
||||
' password = Console.ReadLine()
|
||||
|
||||
' ' Create a new Uri object.
|
||||
' Dim newUri As New Uri(proxyAddress)
|
||||
|
||||
' ' Associate the new Uri object to the myProxy object.
|
||||
' myProxy.Address = newUri
|
||||
|
||||
' ' Create a NetworkCredential object and is assign to the Credentials property of the Proxy object.
|
||||
' myProxy.Credentials = New NetworkCredential(username, password)
|
||||
' myWebRequest.Proxy = myProxy
|
||||
|
||||
' End If
|
||||
' Console.WriteLine(ControlChars.Cr + "The Address of the new Proxy settings are {0}", myProxy.Address)
|
||||
' Dim myWebResponse As WebResponse = myWebRequest.GetResponse()
|
||||
|
||||
' ' Print the HTML contents of the page to the console.
|
||||
' Dim streamResponse As Stream = myWebResponse.GetResponseStream()
|
||||
|
||||
' Dim streamRead As New StreamReader(streamResponse)
|
||||
' Dim readBuff(256) As [Char]
|
||||
' Dim count As Integer = streamRead.Read(readBuff, 0, 256)
|
||||
' Console.WriteLine(ControlChars.Cr + "The contents of the Html pages are :")
|
||||
|
||||
' While count > 0
|
||||
' Dim outputData As New [String](readBuff, 0, count)
|
||||
' Console.Write(outputData)
|
||||
' count = streamRead.Read(readBuff, 0, 256)
|
||||
|
||||
' End While
|
||||
|
||||
' ' Close the Stream object
|
||||
' streamResponse.Close()
|
||||
'streamRead.Close()
|
||||
|
||||
'' Release the HttpWebResponse Resource.
|
||||
' myWebResponse.Close()
|
||||
' Console.WriteLine(ControlChars.Cr + "Press any key to continue.........")
|
||||
' Console.Read()
|
||||
' Catch e As UriFormatException
|
||||
' Console.WriteLine(ControlChars.Cr + "{0}", e.Message)
|
||||
' Console.WriteLine(ControlChars.Cr + "The format of the myProxy address you entered is invalid")
|
||||
' End Try
|
||||
|
||||
|
||||
'End Class
|
||||
Public Module Module1
|
||||
<Extension()>
|
||||
Public Sub Add(Of T)(ByRef arr As T(), item As T)
|
||||
Array.Resize(arr, arr.Length + 1)
|
||||
arr(arr.Length - 1) = item
|
||||
End Sub
|
||||
End Module
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ChartDirector.Net" version="6.4.0" targetFramework="net461" />
|
||||
<package id="ChartDirector.Net.Desktop.Controls" version="6.4.1" targetFramework="net461" />
|
||||
<package id="LiveCharts" version="0.9.7" targetFramework="net461" />
|
||||
<package id="LiveCharts.WinForms" version="0.9.7.1" targetFramework="net461" />
|
||||
<package id="LiveCharts.Wpf" version="0.9.7" targetFramework="net461" />
|
||||
<package id="RestSharp" version="106.11.7" targetFramework="net461" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user