Search results

Working with Data

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.

tagHelper
local-data.cs
<ejs-stockchart id="stockchart" load="stockload" title="AAPL Stock Price">
        <e-stockchart-series-collection>
            <e-stockchart-series type='Candle' xName="x"> </e-stockchart-series>
        </e-stockchart-series-collection>
    </ejs-stockchart>
    <script src="~/financial-data.js"></script>
    <script>
        var data = chartData;
        function stockload(args) {
            args.stockChart.series[0].dataSource = data;
        }
    </script>
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();
        }
    }
}

See Also