Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning DHTMLX Suite UI

You're reading from   Learning DHTMLX Suite UI Create your first single-page JavaScript application using multiple DHTMLX components and a touch of HTML5

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher Packt
ISBN-13 9781849699334
Length 132 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Eli Geske Eli Geske
Author Profile Icon Eli Geske
Eli Geske
Arrow right icon
View More author details
Toc

The application code


For the application, we are going to show a series of data based on the age of each of our users added through the form. This will match up with the grid any time data is changed. As mentioned before we will be using a bar chart and will create all necessary settings in the initialization method with the passed in object.

First, we will add the creation method in our app.js file directly after our form creation method. This will have our global chart variable and create method.

Creating the chart

Add the following code to the app.js file at the end:

// Chart
var appChart;
dhtmlxEvent(window,"load",function(){
   appChart = appLayout.cells("b").attachChart({
      view: "bar",
      value: "#age#",
      label: "#age#",
      gradient: "rising",
      tooltip: {
         template: "#age#"
      },
      xAxis: {
         title: "Users",
         template: "#name#",
         lines: false
      },
      yAxis: {
         title: "Years of Age",
         lines: true
      },...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image