How to draw candle charts in C#

I've used the MSChart and found it to be pretty good. It supports candlestick charts. I've used ZedGraph as well but found a few graphical anomalies showed up on my charts but they were otherwise good as well.


I use this for stock data but its in VB

        With Chart1.ChartAreas("myarea")
            .AxisY.Maximum = (Math.Ceiling((HighValue * 100)) / 100)
            .AxisY.Minimum = (Math.Floor((LowValue * 100)) / 100)
            .AxisY.LabelStyle.Format = "{0.00}"
        End With

        Dim s1 As New Series
        With s1
            .ChartArea = "myarea"
            .ChartType = SeriesChartType.Candlestick
            .XValueType = ChartValueType.String
            .YValueType = ChartValueType.Single
            .YValuesPerPoint = 4
            .CustomProperties = "PriceDownColor=Red, PriceUpColor=Green"
        End With


        For i = Globals.GraphColumns - 1 To 0 Step -1
            OutData = Data_Array.Item(i)

            s1.Points.AddXY(OutData.thedate, OutData.high, OutData.low, OutData.close, OutData.open)


        Next


        Chart1.Series.Add(s1)
        Me.Controls.Add(Chart1)

Tags:

C#

.Net

Charts