Example T540056
Visible to All Users

Dashboard for JavaScript - Create an HTML JavaScript Dashboard Application

The example contains the source code of the project created in this step-by-step tutorial: Create a JavaScript Dashboard Application.

Files to Look At

Documentation

Example Code

HtmlJavaScriptApp/Global.asax.cs(vb)
C#
using DevExpress.DashboardWeb; using DevExpress.DashboardWeb.Mvc; using DevExpress.DataAccess.Web; using System.Web.Mvc; using System.Web.Routing; namespace HtmlJavaScriptApp { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); RouteTable.Routes.MapDashboardRoute("api/dashboard", "DefaultDashboard"); DashboardConfigurator.Default.SetDashboardStorage(new DashboardFileStorage("~/App_Data/Dashboards")); DashboardConfigurator.Default.SetConnectionStringsProvider(new ConfigFileConnectionStringsProvider()); } } }
HtmlJavaScriptApp/index.html
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="referrer" content="origin"> <title>Web Dashboard</title> <link href="node_modules/devextreme/dist/css/dx.light.css" rel="stylesheet" /> <link href="node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css" rel="stylesheet" /> <link href="node_modules/@devexpress/analytics-core/dist/css/dx-analytics.light.css" rel="stylesheet" /> <link href="node_modules/@devexpress/analytics-core/dist/css/dx-querybuilder.css" rel="stylesheet" /> <link href="node_modules/devexpress-dashboard/dist/css/dx-dashboard.light.min.css" rel="stylesheet" /> <script src="node_modules/jquery/dist/jquery.js"></script> <script src="node_modules/knockout/build/output/knockout-latest.js"></script> <script src="node_modules/ace-builds/src-min-noconflict/ace.js"></script> <script src="node_modules/ace-builds/src-min-noconflict/ext-language_tools.js"></script> <script src="node_modules/ace-builds/src-min-noconflict/theme-dreamweaver.js"></script> <script src="node_modules/ace-builds/src-min-noconflict/theme-ambiance.js"></script> <script src="node_modules/devextreme/dist/js/dx.all.js"></script> <script src="node_modules/@devexpress/analytics-core/dist/js/dx-analytics-core.min.js"></script> <script src="node_modules/@devexpress/analytics-core/dist/js/dx-querybuilder.min.js"></script> <script src="node_modules/devexpress-dashboard/dist/js/dx-dashboard.min.js"></script> <script> window.onload = function () { var dashboardControl = new DevExpress.Dashboard.DashboardControl(document.getElementById("web-dashboard"), { // Specifies a URL where the Web Dashboard's server side is hosted. See the MapDashboardRoute method in Global.asax.cs. endpoint: "/api/dashboard" }); dashboardControl.render(); }; </script> </head> <body> <div id="web-dashboard" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0"> </div> </body> </html>

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.