dojo Charts: addSeries()

<html > <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){var chart1 = new dojox.charting.Chart2D(“simplechart”);chart1.addPlot(“default”, {type: “Lines”});chart1.addPlot(“other”, {type: “Areas”, hAxis: “other x”, vAxis: “other y”});chart1.addPlot(“Grid”, {type: “Grid”, hAxis: “other x”,    vAxis: “other y”,hMajorLines: true,    hMinorLines: false,    vMajorLines: true,    vMinorLines: false});chart1.addAxis(“x”, {     labels: [{value: 1, text: "Jan"}, {value: 2, text: "Feb"}, [...]

dojo Charts: Add Grids

<html >
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){var chart1 = new dojox.charting.Chart2D(“simplechart”);chart1.addPlot(“default”, {type: “Lines”});chart1.addPlot(“other”, {type: “Areas”, hAxis: “other x”, vAxis: “other y”});chart1.addPlot(“Grid”, {type: “Grid”, hAxis: “other x”,    vAxis: “other y”,hMajorLines: true,    hMinorLines: false,    vMajorLines: true,    vMinorLines: false});chart1.addAxis(“y”, {vertical: true});chart1.addAxis(“other x”, {leftBottom: false});chart1.addAxis(“other y”, {vertical: true,     leftBottom: false,     [...]

dojo Charts: Coloring Axis

<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){var chart1 = new dojox.charting.Chart2D(“simplechart”);chart1.addPlot(“default”, {type: “Lines”});chart1.addPlot(“other”, {type: “Areas”, hAxis: “other x”, vAxis: “other y”});chart1.addAxis(“x”);chart1.addAxis(“y”, {vertical: true});chart1.addAxis(“other x”, {leftBottom: false});chart1.addAxis(“other y”, {vertical: true,     leftBottom: false,     max: 7,    stroke: “green”,    font: “normal normal bold 14pt Tahoma”,     fontColor: “red”,    majorTick: {color: [...]

dojo Charts: addAxis()

<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){var chart1 = new dojox.charting.Chart2D(“simplechart”);chart1.addPlot(“default”, {type: “Lines”});chart1.addPlot(“other”, {type: “Areas”, hAxis: “other x”, vAxis: “other y”});chart1.addAxis(“x”);chart1.addAxis(“y”, {vertical: true});chart1.addAxis(“other x”, {leftBottom: false});chart1.addAxis(“other y”, {vertical: true, leftBottom: false});chart1.addSeries(“Series 1″, [1, 2, 2, 3, 4, 5, 5, 7]);chart1.addSeries(“Series 2″, [1, 1, 4, 2, 1, 6, 4, [...]

dojo Charts: Multiple Plots

<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){    var chart1 = new dojox.charting.Chart2D(“simplechart”);chart1.addPlot(“default”, {type: “Lines”});chart1.addPlot(“other”, {type: “Areas”});chart1.addAxis(“x”);chart1.addAxis(“y”, {vertical: true});chart1.addSeries(“Series 1″, [1, 2, 2, 3, 4, 5, 5, 7]);chart1.addSeries(“Series 2″, [1, 1, 4, 2, 1, 6, 4, 3], {plot: “other”, stroke: {color:”blue”}, fill: “lightblue”});chart1.render(); };dojo.addOnLoad(makeCharts);</script></head><body><div id=”simplechart” style=”width: 250px; height: 150px;”></div></body></html>
Output:

dojo Charts: Advanced Line Chart

<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){    var chart1 = new dojox.charting.Chart2D(“simplechart”);    chart1.addPlot(“default”, {type: “Lines”, markers: true, tension:3, shadows: {dx: 2, dy: 2, dw: 2}});    chart1.addAxis(“x”);    chart1.addAxis(“y”, {vertical: true});    chart1.addSeries(“Series 1″, [1, 2, 2, 3, 4, 5, 5, 7]);    chart1.render();};dojo.addOnLoad(makeCharts);</script></head><body><div id=”simplechart” style=”width: 250px; height: 150px;”></div></body></html>
Output:

dojo Charts: Area Chart

<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){    var chart1 = new dojox.charting.Chart2D(“simplechart”);    chart1.addPlot(“default”, {type: “Areas”});    chart1.addAxis(“x”);    chart1.addAxis(“y”, {vertical: true});    chart1.addSeries(“Series 1″, [1, 2, 2, 3, 4, 5, 5, 7]);    chart1.render();};dojo.addOnLoad(makeCharts);</script></head><body><div id=”simplechart” style=”width: 250px; height: 150px;”></div></body></html>
output:

dojo Charts: Line Chart

 
<html>
<head runat=”server”><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Untitled 1</title><script type=”text/javascript” src= “../js/dojo/dojo/dojo.js” djConfig=”isDebug: true”></script><script type=”text/javascript”>dojo.require(“dojox.charting.Chart2D”);makeCharts = function(){    var chart1 = new dojox.charting.Chart2D(“simplechart”);    chart1.addPlot(“default”, {type: “Lines”});    chart1.addAxis(“x”);    chart1.addAxis(“y”, {vertical: true});    chart1.addSeries(“Series 1″, [1, 2, 2, 3, 4, 5, 5, 7]);    chart1.render();};dojo.addOnLoad(makeCharts);</script></head><body><div id=”simplechart” style=”width: 250px; height: 150px;”></div></body></html>
 
Output:
 

dojo : Debugging

 
1. Use Firebug or Firebug Lite
Firebug, an open source debugging extension for Firefox, is essential for JavaScript, HTML and CSS debugging. You can download it from the Firebug web site.
2. Logging
In Dojo logging, you can associate messages with severity, just like in log4j. The following code illustrates the five severity levels:
console.log(“Nothing happening”);console.debug(“Checking to make sure [...]

dojo: Send Data by POST

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>       // Load Dojo’s code relating to the Button widget       dojo.require(“dijit.form.Button”);    </script>
<script>       function helloCallback(data,ioArgs) {          alert(data);       }              function helloError(data, ioArgs) {          alert(‘Error when retrieving data from the server!’);       [...]

dojo: Send Data to the Server using Get (Query String)

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>       // Load Dojo’s code relating to the Button widget       dojo.require(“dijit.form.Button”);    </script>
<script>       function helloCallback(data,ioArgs) {          alert(data);       }              function helloError(data, ioArgs) {          alert(‘Error when retrieving data from the server!’);       }</script>
<button [...]

dojo: Read Data from Server using GET

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>       // Load Dojo’s code relating to the Button widget       dojo.require(“dijit.form.Button”);    </script>
<script>       function helloCallback(data,ioArgs) {          alert(data);       }              function helloError(data, ioArgs) {          alert(‘Error when retrieving data from the server!’);       [...]

dojo: Connecting an Event to the Widget

 
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>       // Load Dojo’s code relating to the Button widget       dojo.require(“dijit.form.Button”);    </script>
<button dojoType=”dijit.form.Button” id=”helloButton”>        Hello World!        <script type=”dojo/method” event=”onClick”>           alert(‘You pressed the button’);        </script>    </button>    <style type=”text/css”>    /* CSS  [...]

Dojo : Animation

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”> dojo.addOnLoad(function(){     var animArgs = {    node: “testHeading”,    duration: 1000, // ms to run animation    delay: 250 // ms to stall before playing    };    dojo.fadeOut(animArgs).play();});
    </script>    <style type=”text/css”>    /* [...]

Dojo : connect()

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”> dojo.addOnLoad(function(){    var node = dojo.byId(“testHeading”);    dojo.connect(node,”onclick”,function(){    node.innerHTML = “Click! Click!!”;            });        });   
    </script>    <style type=”text/css”>    /* CSS  */      .testClass {    background-color:red;}     </style>        </head>    <body>         [...]

Dojo : query()

 
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>   dojo.require(“dojo.NodeList-fx”);  dojo.addOnLoad(function(){    // our dom is ready, get the node:    dojo.query(“#testHeading”)         // add “testClass” to its class=”” attribute        .addClass(“testClass”)         // and fade it out after 500 ms        .fadeOut({ delay:500 [...]

Dojo : require()

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>    <script type=”text/javascript”>        dojo.require(“dijit.form.Button”);        dojo.require(“dijit.TitlePane”);        dojo.addOnLoad(function(){          dojo.byId(“testHeading”).innerHTML = “See!! New Heading is here”;          console.log(“Execution Sequence: 1. require()  2. onLoad “);          }); 
    </script>    <style type=”text/css”>    /* CSS  */        </style>        </head>    [...]

Dojo : HelloWorld

dojotest.html

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”     “http://www.w3.org/TR/html4/strict.dtd”><html>    <head>        <title>Dojo</title>        <!– load the dojo toolkit base –>    <script type=”text/javascript” src= “dojo/dojo/dojo.js”        djConfig=”parseOnLoad:true, isDebug:true”></script>
    <script type=”text/javascript”>     // a very common method of loading code onLoad    var init = function(){            console.log(“Hello World in Dojo!!”);        };    dojo.addOnLoad(init);
    // and/or pass an anonymous function    dojo.addOnLoad(function(){            console.log(“Dojo [...]

DOJO : Introduction

Dojo is structured in 4 main projects: Dojo Core, Dijit, DojoX, and Dojo Utilities. Simply including the standard dojo.js gives you:

A very fast, lean (26KB gzipped) core packed full of APIs for XHR, events, DOM, query, animations, namespacing, and other highly used convenience functions.
Optional modules for dates, colors, back button/history, currency, and more

The Dojo [...]

Dojo Examples – II

1. Getting Data
Create one sample file to load in and name it as sample.txt with below textI am a <em>remote</em> file.We used Dojo(Ajax) to put textin our page
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”><html><head><meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″><title>Getting data with Dojo</title><!– load the dojo toolkit base –><script type=”text/javascript” src=”dojo/dojo.js”djConfig=”parseOnLoad:true, isDebug:true”></script><script type=”text/javascript”>var init = function(){var contentNode [...]

Dojo Examples – I

<html><head><title>Dojo Toolkit Working Examples</title> <!– load the dojo toolkit base –><script type=”text/javascript” src=”dojo/dojo.js”djConfig=”parseOnLoad:true, isDebug:true”></script><script type=”text/javascript”>/* our JavaScript will go here */dojo.require(“dijit.form.Button”);dojo.require(“dijit.TitlePane”);dojo.require(“dojo.NodeList-fx”);//——Example – 1————-dojo.addOnLoad(function(){dojo.byId(“testHeading”).innerHTML = “We’re on our way!”console.log(“onLoad fires after require() is done”);dojo.query(“#testHeading”)// add “testClass” to its class=”” attribute.addClass(“testClass”)// and fade it out after 500 ms.fadeOut({ delay:2000 }).play();dojo.query(“.para”).addClass(“testClass”).fadeOut({ delay: 1000 }).play();var node = dojo.byId(“testHeading”);dojo.connect(node,”onclick”,function(){node.innerHTML = [...]

Dojo Tool Kit

1.What is and Why Dojo Toolkit ?

Dojo toolkit is open source DHTML toolkit written in JavaScript. In other words, it is a set of JavaScript libraries.
Dojo toolkit aims to solve some long-standing historical problems with DHTML such as browser incompatibility.
Dojo toolkit also allows you easily add dynamic capabilities into the web pages by the usage [...]