Your search did not match any results.

Charts - JSON Data

If your server stores data in JSON format, you do not need to make AJAX requests to get the data. Instead, assign the URL of your data storage to the Chart's dataSource property. To configure how the component displays data, specify the series type and its nested options: argumentField and valueField, so the component can determine the object fields that indicate Chart arguments and values in JSON.

Note that you can also use a JSONP callback parameter supported by jQuery.ajax() in the dataSource.

Backend API
@(Html.DevExtreme().Chart() .ID("chart") .Rotated(true) .DataSource("https://js.devexpress.com/Demos/WidgetsGallery/JSDemos/data/simpleJSON.json") .Series(s => s.Add() .Label(l => l .Visible(true) .BackgroundColor("#c18e92") ) .Color("#79cac4") .Type(SeriesType.Bar) .ArgumentField("day") .ValueField("sales") ) .Title("Daily Sales") .ArgumentAxis(a => a .Label(l => l .CustomizeText(@<text> function() { return "Day " + this.valueText; } </text>) ) ) .ValueAxis(a => a.Add() .Tick(t => t.Visible(false)) .Label(l => l.Visible(false)) ) .Export(e => e.Enabled(true)) .Legend(l => l.Visible(false)) )
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.NETCore.Demos.Models; using DevExtreme.NETCore.Demos.Models.SampleData; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Controllers { public class ChartsController : Controller { public ActionResult AjaxRequest() { return View(); } } }
#chart { height: 440px; }