Giter VIP home page Giter VIP logo

devexpress-examples / xaf-how-to-display-the-dxchart-widget-in-an-xaf-asp-net-web-forms-view Goto Github PK

View Code? Open in Web Editor NEW
2.0 55.0 0.0 67.82 MB

This example illustrates how to show a dxChart widget with a lot of points in an XAF application

License: Other

C# 50.83% HTML 17.70% JavaScript 3.17% ASP.NET 26.91% Batchfile 1.39%
dotnet xaf framework expressapp expressapp-framework expressappframework

xaf-how-to-display-the-dxchart-widget-in-an-xaf-asp-net-web-forms-view's Introduction

How to display the dxChart widget in an XAF ASP.NET WebForms view

This example illustrates how to show a chart control with many points. The built-in Charts module draws all points on the same screen at once, and this can affect readability. To improve usability, you can implement real-time zooming and scrolling, for example, the dxChart widget from the DevExtreme library. This example shows how to use this widget in an XAF application.

8c96f11b-1ea3-11e6-80bf-00155d62480c

Implementation Details

The approach used in this example is based on the technique of displaying a custom data bound control. The example demonstrates how to use this technique with client-side components that do not have server-side implementation.

  1. Register client libraries. For details, refer to the corresponding section of the How to use DevExtreme Widgets in an XAF application Knowledge Base article.

  2. Create the content. In the YourSolutionName.Web project, create a custom ASP.NET user control (*.ascx) and add ASPxPanel to it that acts as the container for DevExtreme widgets. It is convenient to keep client-side scripts in a separate file. Add a JavaScript file and declare the createWidgets function in it. Implement this function using the approach described in the following topic: Zooming and Panning.

    window.DxSample = window.DxSample || {};
    window.DxSample.OrdersChart = {
        createWidgets: function (panel) {
    	var $mainElement = $(panel.GetMainElement());
    		$mainElement.dxChart({..});
        }
    };

    Using the client-side Init event of the ASPxPanel component, call the createWidgets function and pass the first event argument as this function parameter.

  3. Register your JavaScript files. In code behind for your user control (e.g., YourSolutionName.Web/YourUserControlName.ascx.xx file), handle the UserControl.Load event and call the WebWindow.RegisterClientScriptInclude method to include your JavaScript file into the web page.

  4. Load data and pass it to the client side. To supply data for client-side widgets, use the approach described in the following article: Passing Values Between Client and Server Sides. For this purpose, implement the IComplexControl interface in your UserControl class. Within the IComplexControl.Setup method, load data from the database, convert it to an array of plain objects, and add it to the JSProperties dictionary.

  5. Add your user control to the Application Model using the approach demonstrated in the following article: How to: Show a Custom Data-Bound Control in an XAF View (ASP.NET Web Forms).

Files to Review

Documentation

xaf-how-to-display-the-dxchart-widget-in-an-xaf-asp-net-web-forms-view's People

Contributors

andreykozhevnikov avatar devexpressexamplebot avatar nikolaevairina avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.