Chartjs-ASP. NET Core MVC Problem creating Chart.js Using data from SQL Server

0👍

Modify your js code below:

@if (Model != null)
{
    @foreach (var item in Model.tickerCotacoes)
    {
        @:DataPregao.push('@item.DataPregao');   //add '' surround the @item.DataPregao
                         //add @ before Convert
   @:PrecoUltimoNegocio.push(@Convert.ToDecimal(@item.PrecoUltimoNegocio));  
    }
}

Leave a comment