Jump to content
JChartFX Community
  • 0
Sign in to follow this  
timopu

Problem with PictoGraph instantation

Question

Hello,

 

I'm having problems using pictographs, as the cfx.gauge/pictograph.PictoGraph() constructor fails with following error:

 

angular.js:12416 TypeError: this._0_1 is not a function
    at Object.c [as PictoGraph] (jchartfx.pictograph.js:33)
    at Object._.extend.instance (gauges.js:211)
    at Object._.extend.getChartDOMElement (gauges.js:445)
    at Object.createChart (chartingCommons.js:314)
    at Object.requestChart (chartingCommons.js:360)
    at Object.fn (chartingCommons.js:114)
    at Scope.$digest (angular.js:15753)
    at Scope.$apply (angular.js:16024)
    at HTMLSelectElement.<anonymous> (angular.js:28243)
    at HTMLSelectElement.eventHandler (angular.js:3293)
 
 
I've included coreVector, coreVector3d, gauges and pictograph js files through require-js. Other gauge types work ok, so what could I be missing here?

 

JChartFX version 7.5.5900.27885 (Full).

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

This would be the smallest page using pictograph (a type of gauge, defined inside jchartx.gauge.js)

 

<!DOCTYPE html>

<html>
<head>
<script type="text/javascript" src="../Include/jquery.js">
</script>
<script type="text/javascript" src="jchartfx.system.js">
</script>
<script type="text/javascript" src="jchartfx.coreVector.js">
</script>
<script type="text/javascript" src="jchartfx.gauge.js">
</script>
<script type="text/javascript" language="javascript">
   $(document).ready(function($) {
var pictograph = new cfx.gauge.PictoGraph();
pictograph.getMainMeasure().setValue(3.4);
pictograph.getTotal().setValue(10);
pictograph.create("myDiv");
   });
</script>
</head>
<body>
 
<div id="myDiv" style="width:600px;height:400px;display:inline-block"></div>
 
</body>
</html>
 
If you need a pictobar (a bar chart using pictographs) you would instead do something like this
 
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="../Include/jquery.js">
</script>
<script type="text/javascript" src="jchartfx.system.js">
</script>
<script type="text/javascript" src="jchartfx.coreVector.js">
</script>
<script type="text/javascript" src="jchartfx.pictograph.js">
</script>
<script type="text/javascript" language="javascript">
   $(document).ready(function($) {
var chart1 = new cfx.Chart();
chart1.setDataSource([10,12,14,8]);
var pictobar = new cfx.pictograph.PictoBar();
chart1.setGalleryAttributes(pictobar);
chart1.create("myDiv");
   });
</script>
</head>
<body>
 
<div id="myDiv" style="width:600px;height:400px;display:inline-block"></div>
 
</body>
</html>
 
Hope this helps.
 
JuanC

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...