Candlestick Charts

Candlestick charts are used to describe price movements of a security, derivative, or currency over time.

To create candlestick charts with the FlexChart control, set the bindingX property to the name of the property that contains the dates, and add a single series with binding set to a comma-delimited string containing the names of the properties that represent the High, Low, Open, and Close values.

The size of the wick line is determined by the High and Low values; the size of the bar is determined by the Open and Close values. The bar color indicates whether the Close value is higher or lower than the Open value (empty/filled bar):

Feb 3Feb 10Feb 17Feb 24Mar 3Mar 10Mar 17800820840
1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1FlexChartController : Controller
    {
        // GET: CandlestickCharts
        public ActionResult CandlestickCharts()
        {
            return View(Models.FlexChartData.GetStocks2());
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@using LearnMvcClient.Models
@model IEnumerable<FlexChartData.Stock>
 
<h1>
    @Html.Raw(Resources.C1FlexChart.CandlestickCharts_Title)
</h1>
 
<p>
    @Html.Raw(Resources.C1FlexChart.CandlestickCharts_Text1)
</p>
<p>
    @Html.Raw(Resources.C1FlexChart.CandlestickCharts_Text2)
</p>
<p>
    @Html.Raw(Resources.C1FlexChart.CandlestickCharts_Text3)
</p>
 
@(Html.C1().FlexChart<FlexChartData.Stock>().Id("theChart")
    .Bind("Date", Model)
    .ChartType(C1.Web.Mvc.Chart.ChartType.Candlestick)
    .Series(sb=>sb.Add().Binding("High,Low,Open,Close").Name("Alphabet Inc"))
    .Legend(C1.Web.Mvc.Chart.Position.None)
)