HTTPS SSH

Charting Project

Encapsulates the Visual Studio chart control.

Getting Started

Clone the project along with its requisite projects to their respective relative path. All projects are installed relative to a common path.

Line Chart Control

Add the line chart control to a control (MeterChartControl) or a form in place of MS Chart.

Add handler for updating the tool tip

Public Class MeterChartControl

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        AddHandler Me._Chart.GetToolTipText, AddressOf Me._Chart.OnGetTooltipText
    End Sub

    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
                If Me._Chart IsNot Nothing Then
                    RemoveHandler Me._Chart.GetToolTipText, AddressOf Me._Chart.OnGetTooltipText
                End If
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

End Class   

Initialize

    Public Sub InitializeKnownState()
        Me.Chart.AddTitle("Frequency Distribution")
        Me.Chart.InitializeCustomPalette()
        Me.Chart.InitializeChartArea(False)
    End Sub

Display

    Public Function Simulate() As Series
        Dim l As New List(Of Double)
        Dim rnd As New Random
        For i As Integer = 1 To 20000
            l.Add(rnd.NextNormal)
        Next
        Return Me.Display(l.ToArray)
    End Function

    ''' <summary> Name of the histogram series. </summary>
    Public Const HistogramSeriesName As String = "histogram"

    Public Function Display(ByVal values As IEnumerable(Of Double)) As Series
        Dim lowerLimit As Double = -3
        Dim upperLimit As Double = 3
        Dim count As Integer = 51
        Dim result As IEnumerable(Of Windows.Point) = values.HistogramDirect(lowerLimit, upperLimit, count)
        Dim ser As Series = Me.Chart.GraphLineSeries(MeterChartControl.HistogramSeriesName, SeriesChartType.FastLine, result)
        Me.Chart.ChartArea.AxisX.Minimum = -3
        Me.Chart.ChartArea.AxisX.Maximum = 3
        Return ser
    End Function

Prerequisites

The following projects are also required: Core - Core Project Share - Shared snippets * Share - Charting Project

git clone git@bitbucket.org:davidhary/vs.share.git
git clone git@bitbucket.org:davidhary/vs.core.git
git clone git@bitbucket.org:davidhary/vs.charting.git

Installing

Install the projects into the following folders:

Projects relative path

.\Libraries\VS\Share
.\Libraries\VS\Core\Core
.\Libraries\VS\Visualizing\Charting

Testing

The project includes a few unit test classes. Test applications are under the Apps solution folder.

Deployment

Deployment projects have not been created for this project.

Built, Tested and Facilitated By

Authors

  • David Hary - Initial Workarounds - ATE Coder

License

This project is licensed under the MIT License - see the [LICENSE.md] file at (https://www.bitbucket.org/davidhary/vs.charting/src) for details

Acknowledgments

Revision Changes

  • Version 2.0.6083 08/27/16 Changes line chart to a control.