[jqPlot] Axes d'un graphique
Bonjour bonjour,
Mon problème est simple : Le label de mon Xaxis ne se situe pas où je le voudrais. J'aimerai qu'il soit sur les | et pas au milieu.
http://img11.hostingpics.net/pics/507344graph.png
Voici mon code JS :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <script type="text/javascript" class="code">
$(document).ready(function() {
graph('Graph');
graph('Camember');
});
function graph(div) {
var traf = <?php echo json_encode($sommeTraf);?>;
var abscisseSem = <?php echo json_encode($nbSem);?>;
var plot1 = $.jqplot ('Graph', [traf], {
axes : {
xaxis : {
renderer : $.jqplot.CategoryAxisRenderer,
ticks : abscisseSem
}
},
cursor:{
show: true,
zoom: true
}
});
var nomeq = <?php echo json_encode($tabEq);?>;
var valeach = <?php echo json_encode($pourcent);?>;
var tabFin = [];
for (i = 0 ; i < valeach.length ; i++)
{
tabFin.push([nomeq[i],valeach[i]]);
}
var plot2 = $.jqplot ('Camember', [tabFin],
{
title: ' ',
seriesDefaults: {
shadow: false,
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
startAngle: 180,
sliceMargin: 4,
showDataLabels: true }
},
legend: { show:true, location: 'w' }
}
);
}
</script> |
Je ne sais pas comment faire pour le placer correctement, j'ai pourtant épluché tous les exemples sur jQplot mais en vain.
Avez vous des idées ?
Merci d'avance !