Search results

Working with Data in ASP.NET MVC Stock Chart control

22 Jul 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
@Html.EJS().StockChart("container").Title("AAPL Stock Price")
                                                                        .Series(sr =>
    <script src="~/financial-data.js"></script>                                                                   .Render())
        var data = window.chartData;
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();

See Also