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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×