Ich entwickle Plugin, wo ich jqplot für Balkendiagramme verwende, habe ich in der gleichen Weise wie sie in documentaion gesagt, aber in Wordpress funktioniert nicht, aber es funktioniert in normalen PHP, unten ist mein CodeWie jqplot in WordPress enthalten?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/js/jquery.jqplot.js"></script>
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/js/jqplot.barRenderer.js"></script>
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/js/jqplot.pieRenderer.js"></script>
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/js/jqplot.categoryAxisRenderer.js"></script>
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/js/jqplot.pointLabels.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo WP_PLUGIN_URL; ?>/css/jquery.jqplot.css" />
<script>
$(document).ready(function(){
$.jqplot.config.enablePlugins = true;
var s1 = [2, 6, 7, 10];
var ticks = ['a', 'b', 'c', 'd'];
plot1 = $.jqplot('chart1', [s1], {
// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
animate: !$.jqplot.use_excanvas,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});
$('#chart1').bind('jqplotDataClick',
function (ev, seriesIndex, pointIndex, data) {
$('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
}
);
});
</script>
<div id="chart1" style="height:400px;width:300px; "></div>
Haben Sie Fehler in der Debug-Konsole? –
in Wordpress es funktioniert nicht und es ist leer, ich brauche es in Wordpress, funktioniert es gut in normalen PHP –
Überprüfen Sie Ihre Browser-Konsole für Javascript-Fehler. –