creating diagrams | WordPress.org

[ad_1]

I don’t understand how to insert a diagram into Calculated Fields Forms using CP Blocks; when adding a diagram, the code appears

<!--BLOCK_ID_74--><script>if(typeof chartjsBlock=='undefined'){chartjsBlock={'queue':[],'loading':false,'formatNumber':function(v){v=(new String(v)).replace(/[^\d\.\-]/g,'');if(!isNaN(v)) return v*1;throw'Not a Number';},'getColor':function(i){var COLORS=['#4dc9f6','#f67019','#f53794','#537bc4','#acc236','#166a8f','#00a950','#58595b','#8549ba'];return COLORS[i%COLORS.length];},'clear':function(id){var e=jQuery('#'+id),n=jQuery('<canvas></canvas>');n.attr('id',id).width(e.width()).height(e.height());e.replaceWith(n);},'callback':function(){while(this.queue.length){var i=this.queue.shift();i['chart'].apply(this,i['args']);}}};} chartjsBlock['pieChart']=function(canvasId,data,config){var me=this,options={responsive:!(document.getElementById(canvasId).offsetParent===null),animation:false,plugins:{legend:{display:true},title:{display:true}},cutout:0,},labels=[],values=[],colors=[];me.clear(canvasId);if(typeof config['title']=='string'){options['plugins']['title']['display']=true;options['plugins']['title']['text']=config['title'];delete config['titlel'];} jQuery.extend(true,options,config);if(typeof data==='object'&&typeof data['length']!=='undefined'){for(var i in data){var d=data[i],v;try{if(typeof d==='object'){if(typeof d['value']==='undefined') throw'Data Required';v=me.formatNumber(d.value);values.push(v);labels.push((typeof d['label']!=='undefined')?d.label:'');colors.push((typeof d['color']!=='undefined')?d.color:me.getColor(i));}else{v=me.formatNumber(d);values.push(v);labels.push('');colors.push(me.getColor(i));} if(v<0) options.scales.y.beginAtZero=false;}catch(err){continue;}}} new Chart(document.getElementById(canvasId),{type:'pie',data:{labels:labels,datasets:[{fill:false,data:values,backgroundColor:colors}]},options:options});};window['setPieChartBlock']=function(id,items,config){if(typeof id==='undefined') return;var c=document.getElementById(id);if(!c||c.tagName!=='CANVAS') return;if(typeof config==='undefined') config={};chartjsBlock.queue.push({'chart':chartjsBlock.pieChart,'args':[id,items,config]});if(typeof window['Chart']==='undefined'){if(!chartjsBlock.loading){jQuery.getScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js',function(){chartjsBlock.callback();});} chartjsBlock.loading=true;return;} chartjsBlock.callback();};</script><!--END_BLOCK_ID_74-->
  • This topic was modified 1 hour, 25 minutes ago by ruslanfwc.
  • This topic was modified 1 hour, 22 minutes ago by ruslanfwc.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer