PDA

View Full Version : Excanvas



jhoy
23 Jul 2010, 02:33 PM
Hello Everyone,

First I searched around and I found no one asking this question so hopefully someone out there will know the answer.

Anyway, I am working excanvas trying to get it to work with I.E 8 which I added the meta tag to make it just use I.E 7 and the canvas to a degree is working. However, context.strokeText("text", 0, 0) is not.

So I went out and found canvas.text.js and typeface and added them to my page. StrokeText is now recognized and it runs but it goes crazy. Instead of adding the text to the canvas it just outputs black all over the place and that is it.

html side looks like this:

<script language="javascript" type="text/javascript" src="js/graphcanvas.js"></script>

<!--[if IE]><script language="javascript" src="js/bluff/excanvas.js" type="text/javascript"></script><![endif]-->
<script type="text/javascript" src="js/bluff/canvas.text.js"></script>
<script type="text/javascript" src="js/bluff/optimer_regular.typeface.js"></script>

<div id="graphdiv" class="typeface-js" style="font-family: Optimer">
<canvas id="myCanvas" width="600" height="800" style="position: absolute;"></canvas>
</div>

graphcanvas.js looks like this

var elem = document.getElementById('myCanvas');

if (window.G_vmlCanvasManager && window.attachEvent && !window.opera) {
elem = window.G_vmlCanvasManager.initElement(elem);
}


var context = elem.getContext('2d');

if (context) {
// Create a stackedGraphContext used to draw the graph.
var stgContext = new stackedGraphContext(context);

// Create a stackedGraphObj that stores the context and the json data.
var stg = new stackedGraphObj(stgContext, myJSONObject);

// Calls the stackedGraphObj.draw method to draw the graph.
stg.draw();
}

and in draw is where

and this is where it is not having a fun time with.

this.StackedGraphContext.context.strokeText(values[val], x + this.StackedGraphContext.text_x_padding, y + this.StackedGraphContext.text_y_padding);

If anyone could point me or know what is causing this I would be really appreciative!!!