Chart not rendering in post/page but does in admin
-
Warning: Creating default object from empty value in C:\wamp\www\bobtest201401\wp-content\plugins\wp-business-intelligence-lite\classes\backend\dao\dao_database.php on line 86
Chart does not render on a post but does in wp-admin/admin.php?page=charts
Trying out the lite version this morning after getting the updated 1.2.1 version.
https://wordpress.org/plugins/wp-business-intelligence-lite/
-
I found an error in my shortcode:
[wpbusinessintelligence id=”2″ type=”chart” iframe=”n” ]Pushups[/[wpbusinessintelligence]. I corrected this to:
[wpbusinessintelligence id=”2″ type=”chart” iframe=”n” ]Pushups[/wpbusinessintelligence]. I don’t get the error, but it does not render in the post even though it does in the edit/test section.Do you see any error in the JS console of your browser? (ctrl+shift+I) on Chrome/Firefox.
Any other error in the log file apart from the warning?
thanksAnother thing, which type of chart is that? (line, bar, pie?)
Thanks for the quick reply.
This one is a Bar Chart
There is a jQuery error in there:GET http://localhost:8080/bobtest201401/ [HTTP/1.1 200 OK 736ms]
GET http://fonts.googleapis.com/css [HTTP/1.1 200 OK 584ms]
GET http://localhost:8080/bobtest201401/wp-includes/css/dashicons.min.css [HTTP/1.1 304 Not Modified 30ms]
GET http://localhost:8080/bobtest201401/wp-includes/css/admin-bar.min.css [HTTP/1.1 304 Not Modified 45ms]
GET http://localhost:8080/bobtest201401/wp-content/themes/focus/style.css [HTTP/1.1 304 Not Modified 58ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/nv.d3.css [HTTP/1.1 304 Not Modified 66ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/lib/d3.v3.js [HTTP/1.1 304 Not Modified 855ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/nv.d3.min.js [HTTP/1.1 304 Not Modified 854ms]
GET http://localhost:8080/bobtest201401/wp-includes/js/admin-bar.min.js [HTTP/1.1 304 Not Modified 854ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/tooltip.js [HTTP/1.1 304 Not Modified 854ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/utils.js [HTTP/1.1 304 Not Modified 867ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/models/legend.js [HTTP/1.1 304 Not Modified 876ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/models/axis.js [HTTP/1.1 304 Not Modified 888ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/models/discreteBar.js [HTTP/1.1 304 Not Modified 894ms]
GET http://localhost:8080/bobtest201401/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/js/src/models/discreteBarChart.js [HTTP/1.1 304 Not Modified 898ms]
GET http://fonts.googleapis.com/css [HTTP/1.1 200 OK 337ms]
GET http://fonts.googleapis.com/css [HTTP/1.1 200 OK 789ms]
GET http://localhost:8080/bobtest201401/wp-content/themes/focus/images/bg.jpg [HTTP/1.1 304 Not Modified 32ms]
GET http://localhost:8080/bobtest201401/wp-content/themes/focus/images/wrap.png [HTTP/1.1 304 Not Modified 36ms]
GET http://localhost:8080/bobtest201401/wp-content/uploads/2014/03/cropped-TheLocalsPage.jpg [HTTP/1.1 304 Not Modified 38ms]
ReferenceError: jQuery is not defined bobtest201401:44
GET http://localhost:8080/bobtest201401/wp-content/uploads/2014/03/TheLocalsPage-280×100.jpg [HTTP/1.1 304 Not Modified 22ms]
GET http://0.gravatar.com/avatar/4d8d8f414ec464093e36a6597998af16 [HTTP/1.1 304 Not Modified 60ms]
GET http://0.gravatar.com/avatar/4d8d8f414ec464093e36a6597998af16 [HTTP/1.1 304 Not Modified 64ms]
GET http://localhost:8080/bobtest201401/wp-content/themes/focus/images/footer-top.png [HTTP/1.1 304 Not Modified 23ms]
GET http://localhost:8080/bobtest201401/wp-content/themes/focus/images/icon-comments.png [HTTP/1.1 304 Not Modified 32ms]“ReferenceError: jQuery is not defined”
it seems that the WP install has some issues since it’s not able to find jQuery.This seems the output of the network tab (Firefox). Any chance to look at the JS console? It should also point to the file that is causing issues.
Would you be able to roll-back to 1.2 just to check that the issue is from the update and not from something else?
This is from the Console with just JS:
ReferenceError: jQuery is not definedI have just gone out to a hosted live site and installed 1.2.1 and it works out there. My InstantWP install may be the issue. I will investigate further.
You may mark it as resolved if you wish.
OK thanks Bob, good luck with your investigation.
cheers,I may have a related issue. I can see a simple test bar chart in the admin area. Nothing renders in a post.
I can see with Chrome dev that the div entry for the chart is generated
When I use Chrome dev to inspect javascript I see Syntax Error “Unexpected number” error at line 101. It appears to be that the value for label is not surrounded by quotes.
“values”: [ { “label” : “”, “value” : 2014-04-15 11:25:12, “color” : “#2d12c1”}, { “label” : “”, “value” : 2014-04-15 13:12:45, “color” : “#2d12c1”} ],
“color”: “#2d12c1”,Here’s the entry:
http://lei.risk-management-and-compliance.org/?p=6Thanks in advance for any guidance
SteveP.S.
Here’s the JS that is generated by the Plugin ….
<div id=”ph_Pie_Chart_Test”>
<svg></svg>
</div>jQuery(document).ready(function() {
var nvd3Data_ph_Pie_Chart_Test = [ {
“key”: “user_registered”,
“values”: [ { “label” : “”, “value” : 2014-04-15 11:25:12, “color” : “#2d12c1”}, { “label” : “”, “value” : 2014-04-15 13:12:45, “color” : “#2d12c1”} ],
“color”: “#2d12c1”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} , {
“key”: “user_status”,
“values”: [ { “label” : “”, “value” : 0, “color” : “#190190”}, { “label” : “”, “value” : 0, “color” : “#190190”} ],
“color”: “#190190”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} , {
“key”: “display_name”,
“values”: [ { “label” : “”, “value” : Evengers, “color” : “#c31c21”}, { “label” : “”, “value” : LEI Admin LEI Admin, “color” : “#c31c21”} ],
“color”: “#c31c21”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} ];</p>
<p> nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.staggerLabels( true )
.tooltips( true )
.showValues( true )
.valueFormat(d3.format(‘.1f’));</p>
<p> chart.yAxis
.tickFormat(d3.format(‘.1f’));</p>
<p> d3.select(‘#ph_Pie_Chart_Test svg’)
.datum(nvd3Data_ph_Pie_Chart_Test)
.transition().duration(500)
.call(chart);</p>
<p> nv.utils.windowResize(chart.update);</p>
<p> d3.selectAll(‘.nv-bar’).attr(‘class’, ‘ph_Pie_Chart_TestClass’);</p>
<p> return chart;
});
});</p>
<p>It looks like the values selected make no sense. You should have a single column selected as “value” and another as “label”. In your dataset I see several values from zeros to dates. This makes no sense for a pie chart. You should have one data serie with numerical values (the pie slices) and another with the text labels.
Hi Claudio et al. I have the same problem with the Lite version v1.5 on WP4.0 on W7 using the DesktopServer XAMPLite stack, namely that a (pie) chart will not render on a page when using a short-code. I also get the jQuery error in the console when viewing the page. As per a previous poster, the pie chart displays just fine in the admin section.
I used the Chrome browser “inspect element” on the offending page and it seems that in the <head> section there is a slash (/) missing between the domain and the sub-folder wp-includes:
<script type=”text/javascript” src=”http://referral.devwp-includes/js/jquery/jquery.js?ver=1.11.0″></script>
My test domain in this example is referral.dev
There are plenty of script references that are well formed (mainly to sub-folder /wp-content) but both the ones under /wp-includes appear to be missing the ‘/’ folder separator.
Hope that helps and please let me know if this means there is a fix in the pipeline 🙂 Thanks.
Hello Ardibee,
wp-includes is a WP folder that has nothing to do with plugins, so the missing slash is not coming from WPBI.
The wrong URL for jQuery can for sure interfere with displaying the chart, but I am afraid that this could come from some other plugin or theme.
Please try to see if you have the same malformed url in a blank page created from scratch. These would exclude any issue with WPBI.
cheers,
C.Hi Claudio,
I see your point but I just checked all the other pages on this site, created the same way and only the page with the WPBI plug in throws this error… I even tried changing themes to 2014 to see if it was Responsive. Same problem. I deactivated every plugin except WPBI, same problem.
I checked the console again. The problem appears to stem from file view.php, which contains include_once(‘includes.php’). Please could you take another look?
Thanks.OK I see,
I’ll have a lookHi Claudio – any luck?
- The topic ‘Chart not rendering in post/page but does in admin’ is closed to new replies.