Search results

Working with Data in ASP.NET Core Stock Chart control

19 Oct 2021 / 1 minute to read

Chart can visualise data bound from local or remote data.

Local Data

You can bind a simple JSON data to the chart using dataSource property in series.

Copied to clipboard
<ejs-stockchart id="stockchart" load="stockload" title="AAPL Stock Price">
            <e-stockchart-series type='Candle' xName="x"> </e-stockchart-series>
    <script src="~/financial-data.js"></script>
        var data = chartData;
        function stockload(args) {
            args.stockChart.series[0].dataSource = data;
Copied to clipboard
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers.StockChart
    public partial class StockChartController : Controller
        public IActionResult Default()
            return View();
        public class ChartData
            public DateTime x;
            public double high;
            public double low;
            public double close;
            public double open;
            public int volume;

See Also