• 2 replies
  • Latest Post - ‏2013-02-08T00:30:21Z by SystemAdmin
2327 Posts

Pinned topic Errors when using dojo charts

‏2013-01-29T22:38:32Z |
Hi, I am trying to use dojo charts. I created a view and included a simple chart.

I am using Worklight 5.0.5.

It builds fine, but upon running, I get the Failed to load resource error errors (404) for the following:


MyMobileChart.html page:

<link rel="stylesheet" type="text/css" href="dijit/themes/dijit.css">
<link rel="stylesheet" type="text/css"
window.$ = window.jQuery = WLJQ;
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript"
data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false"
<link rel="stylesheet" href="css/MyMobileChart.css">
<body id="content" style="display: none;" class="claro">
<div data-dojo-type="" id="defaultView"
<h1 data-dojo-type=""
<div data-dojo-type="dojox.charting.widget.Chart"
style="width: 100%; height: 300px;">
<div class="plot" name="grid" type="Grid" vMinorLines="true"></div>
<div class="axis" name="x" fixUpper="minor" majorTickStep="1"
<div class="axis" name="y" vertical="true" min="0"></div>
<div class="plot" name="plot" type="Columns"></div>
<div class="series" name="data" plot="plot"
data="20, 32, 32, 45, 37, 28, 24, 48, 44, 21, 32, 33,
32, 34, 44, 32, 39, 43, 44, 46, 36, 41, 25, 27,
28, 45, 46, 33, 34, 35, 29, 44, 48, 48, 49, 43"></div>


<!--application UI goes here-->
<script src="js/initOptions.js"></script>
<script src="js/MyMobileChart.js"></script>
<script src="js/messages.js"></script>

MyMobileChart.js page:

function wlCommonInit(){
require([ "dojo/core-web-layer", "dojo/mobile-ui-layer",
"dojo/mobile-compat-layer" ], dojoInit);

function dojoInit() {
require([ "dojo", "dojo/parser", "dojox/mobile", "dojox/mobile/parser", "dojox/mobile/compat", "dojox/mobile/deviceTheme", "dojox/mobile/ScrollableView", "dojox/mobile/View", "dojox/charting/widget/Chart", "dojox/mobile/Heading","dojox/charting/axis2d/Default", "dojox/charting/plot2d/Columns","dojox/charting/plot2d/Grid"
function(dojo) {
dojo.ready(function() {



A portion of the build-dojo.xml file (I removed the commentted out includes):

Use this section to customize the Dojo Toolkit layers that you want to deploy with your application.
The mobile-related layers are not managed in this section.
<patternset id="dojo.resources.layers">
<include name="dojo/dojo.js.compressed.js"/>
<include name="dojo/core-web-layer.js.compressed.js"/>

<include name="dojo/dijit-layer.js.compressed.js"/>
<include name="dojo/calendar-layer.js.compressed.js"/>
<include name="dojo/charting-layer.js.compressed.js"/>
<include name="dojo/dgauges-layer.js.compressed.js"/>
<include name="dojo/graphics-layer.js.compressed.js"/>
<include name="dojo/treemap-layer.js.compressed.js"/>



Any suggestions would be helpful.
  • browe
    11 Posts

    Re: Errors when using dojo charts


    This may be a defect. In your wlCommonInit() method, could you add dojo/charting-layer to the requires list and see if that works?

    • Billy
  • SystemAdmin
    2327 Posts

    Re: Errors when using dojo charts

    Note: IBM forums are in the process of migrating to a new format. During migration the forums will be frozen and in read-only mode. If you wish to continue this thread discussion please post it on stackoverflow, where the Worklight team and others can respond.

    See the Forum Migration announce post for more details. Thank you.

    Barbara Hampson, Manager, IBM Worklight