How to draw candle charts in C#

2019-06-17 05:01发布

How can I draw candle charts in C#? Does anybody has any examples with a nice interface?

标签: c# .net charts
6条回答
放我归山
2楼-- · 2019-06-17 05:20

I'm using the .netCharting library for this and it's pretty good. It supports all sorts of charts - candle included. One thing to watch out for is that with the current version (5.3) you have to reverse the high and low price - a pretty ugly and obvious bug. It's a commercial product, but reasonably priced, so could be worth it, depending on your project.

查看更多
唯我独甜
3楼-- · 2019-06-17 05:24

Maybe ChartDirector can be a good solution

http://www.advsofteng.com/doc/cdcomdoc/candlestick.htm

查看更多
戒情不戒烟
4楼-- · 2019-06-17 05:25

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.

查看更多
混吃等死
5楼-- · 2019-06-17 05:37

ZedGraph is a very easy-to-use LGPLed charting library that can handle candlestick charts.

If you need to save an image to disk, it can do that. If you need to display an interactive graph that supports zooming/panning, it can do that as well with the excellent ZedGraphControl control.

查看更多
姐就是有狂的资本
6楼-- · 2019-06-17 05:44

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)
查看更多
The star\"
7楼-- · 2019-06-17 05:46

Try xamChart Control Trial version from Infragistics.

Here is another sample at CodeProject

查看更多
登录 后发表回答