Your search did not match any results.
Charts

Ajax Request

Documentation
If your server stores data in JSON format, making AJAX requests is inevitable. But instead of configuring these requests manually, assign the URL of your data storage (in this demo, a JSON file) to the dataSource option, and the Chart will do the rest.
@(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() .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.MVC.Demos.Models.SampleData; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ChartsController : Controller { public ActionResult AjaxRequest() { return View(); } } }
namespace DevExtreme.MVC.Demos.Models { public class DaySales { public int Day { get; set; } public int Sales { get; set; } } }
using System.Collections.Generic; namespace DevExtreme.MVC.Demos.Models.SampleData { public partial class SampleData { public static List<DaySales> DaySales = new List<DaySales> { new DaySales { Day = 1, Sales = 4 }, new DaySales { Day = 2, Sales = 2 }, new DaySales { Day = 3, Sales = 10 }, new DaySales { Day = 4, Sales = 7 }, new DaySales { Day = 5, Sales = 7 }, new DaySales { Day = 6, Sales = 6 }, new DaySales { Day = 7, Sales = 2 }, new DaySales { Day = 8, Sales = 2 }, new DaySales { Day = 9, Sales = 4 }, new DaySales { Day = 10, Sales = 9 } }; } }
#chart { height: 440px; }