Help us shape the 2021 DevExtreme Roadmap. Take our 5 minute survey.
Dismiss
Your search did not match any results.
Charts

JSON Data

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 property, 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() .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.MVC.Demos.Models.SampleData; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ChartsController : Controller { public ActionResult AjaxRequest() { return View(); } } }
#chart { height: 440px; }