Skip to content
CHARTS · COMPLETE

CandlestickChart

Present open, high, low and close for each period, the way traders expect.

Present open, high, low and close for each period, the way traders expect, with optional volume and indicators.

Why it helps

  • Open, high, low, close
  • Volume and indicators
  • Zoom and range selection

Where it fits

  • Prices
  • Rates
  • Market data

Example

<CandlestickChart Label="Share price" Items="_items" ValueFormat="#,0.00" />

@code {
    private readonly CandleItem[] _items = Build();

    private static CandleItem[] Build()
    {
        var random = new Random(7);
        var price = 100.0;
        var items = new List<CandleItem>();

        for (var day = 1; day <= 24; day++)
        {
            var open = price;
            var close = open + (random.NextDouble() - 0.45) * 8;
            var high = Math.Max(open, close) + random.NextDouble() * 3;
            var low = Math.Min(open, close) - random.NextDouble() * 3;
            items.Add(new CandleItem($"D{day}", open, high, low, close, 800 + random.Next(0, 900)));
            price = close;
        }

        return items.ToArray();
    }
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Part of RayCraft Complete.

All controls ยท Documentation