Opened 9 years ago

Closed 8 years ago

#11522 closed defect (fixed)

javascript error during chart1.render() execution

Reported by: John McDonald Owned by: Eugene Lazutkin
Priority: high Milestone: 1.7
Component: Charting Version: 1.5
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

I am receiving the following error when executing chart1.render(); more than once:

o is undefined in dojo.js line 73

The attached code runs fine during the execution of the first chart1.render(); but receives the error when the second execution occurs.

  • Remove {plot: "other"} from
chart1.addSeries("Series B", [{x: 0.3, y: 8}, {x: 4, y: 6, tooltip: "Custom tooltip"}, {x: 5.5, y: 2}], {plot: "other"});

and the error won't occur.

  • Remove "markers: true" from
chart1.addPlot("default", {type: "Default", lines: true, markers: true, tension:2});

and the error will occur.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<title>Event 2D</title>
<style type="text/css">
	@import "dojo-release-1.5.0/dojo/resources/dojo.css";
	@import "dojo-release-1.5.0/dijit/tests/css/dijitTests.css";
</style>
<!-- required for Tooltip: a default dijit theme: -->
<link rel="stylesheet" href="dojo-release-1.5.0/dijit/themes/tundra/tundra.css">
<style>
.dojoxLegendNode {border: 1px solid #ccc; margin: 5px 10px 5px 10px; padding: 3px}
.dojoxLegendText {vertical-align: text-top; padding-right: 10px}
</style>
<script type="text/javascript" src="dojo-release-1.5.0/dojo/dojo.js" djConfig="isDebug: true"></script>
<script type="text/javascript">

dojo.require("dojox.charting.Chart2D");
dojo.require("dojox.charting.themes.PlotKit.green");

dojo.require("dojox.charting.action2d.Highlight");
dojo.require("dojox.charting.action2d.Magnify");
dojo.require("dojox.charting.action2d.MoveSlice");
dojo.require("dojox.charting.action2d.Shake");
dojo.require("dojox.charting.action2d.Tooltip");

dojo.require("dojox.charting.widget.Legend");

dojo.require("dojo.colors");
dojo.require("dojo.fx.easing");

var dc = dojox.charting;

var dur = 450;

makeObjects = function(){
	var chart1 = new dc.Chart2D("test1");
	//chart1.setTheme(dc.themes.PlotKit.green);
	chart1.addPlot("default", {type: "Default", lines: true, markers: true, tension:2}); 
        chart1.addPlot("other", 	{type: "Lines",
		  hAxis: "other x",
		  vAxis: "other y"
	  });
	chart1.addPlot("grid", 	{type: "Grid",
          	  hMajorLines: true,
        	  hMinorLines: false,
        	  vMajorLines: true,
        	  vMinorLines: false
	  });
	chart1.addAxis("x", {min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
	chart1.addAxis("y", {vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
	chart1.addAxis("other x", {leftBottom: false, min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
	chart1.addAxis("other y", {leftBottom: false, vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
	chart1.addSeries("Series A", [{x: 0.5, y: 5}, {x: 1.5, y: 1.5}, {x: 2, y: 9}, {x: 5, y: 0.3}]);
	chart1.addSeries("Series B", [{x: 0.3, y: 8}, {x: 4, y: 6, tooltip: "Custom tooltip"}, {x: 5.5, y: 2}], {plot: "other"}); //, {plot: "other"}
	var anim1a = new dc.action2d.Magnify(chart1, "default");
	var anim1b = new dc.action2d.Tooltip(chart1, "default");
	chart1.render();
	chart1.render();
	var legend1 = new dojox.charting.widget.Legend({chart: chart1, horizontal: false}, "legend1");

};

dojo.addOnLoad(makeObjects);

</script>
</head>
<body class="tundra">
<h1>Event 2D</h1>
<!--<p><button onclick="makeObjects();">Go</button></p>-->
<p>Hover over markers, bars, columns, slices, and so on.</p>
<p>1: Markers, lines, 2D data, custom axis. Actions: Magnify, Tooltip.</p>
<div id="test1" style="width: 400px; height: 200px;"></div>
<div id="legend1"></div>

<div id="legend10"></div>
<p>That's all Folks!</p>
</body>
</html>

Attachments (1)

test.html (3.2 KB) - added by John McDonald 9 years ago.
test html file

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by John McDonald

Attachment: test.html added

test html file

comment:1 Changed 9 years ago by Eugene Lazutkin

Component: GeneralCharting
Milestone: tbdfuture
Owner: changed from anonymous to Eugene Lazutkin
Status: newassigned

Could you attach a minimal test case as a file attachment?

comment:2 Changed 9 years ago by John McDonald

Minimal test case (test.html) already attached.

comment:3 Changed 8 years ago by cjolif

Cc: cjolif added

goinoff I don't reproduce in 1.7 with either Firefox or Chrome.

1/ do you reproduce in 1.7? 2/ which browser are you reproducing the problem with?

comment:4 in reply to:  3 Changed 8 years ago by John McDonald

Replying to cjolif:

goinoff I don't reproduce in 1.7 with either Firefox or Chrome.

1/ do you reproduce in 1.7? 2/ which browser are you reproducing the problem with?

I was using Firefox and IE at the time...Long time ago...Not sure what versions. I haven't upgraded to 1.7 yet so I can't test it. I guess it's not an issue now. 8)

comment:5 Changed 8 years ago by cjolif

Milestone: future1.7
Resolution: fixed
Status: assignedclosed

This seem to be working now in 1.7. Feel free to re-open if you still reproduce it.

Note: See TracTickets for help on using tickets.