jqPlot は、グラフ上にあるすべてのシリーズのラベルを表示します。シリーズの一部だけをラベルに表示したい。問題は、値の適切な制限を (視覚的に) 示すために、いくつかの線がそこにあるということです。いくつかの点は上にあり、いくつかは下にあります。今のところ、ラベルに空の文字列を配置するだけですが、ラベル領域のラベル ポイントはまだそこにあり、見栄えがよくありません。
コードは次のとおりです。
series:[
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{lineWidth:0.5, color: 'red', showMarker: false},
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{lineWidth:1, color: '#76a4e8', showMarker: false},
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{lineWidth:0.5, color: 'red', showMarker: false},
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{lineWidth:1, color: '#d8d8d8', showMarker: false},
{
lineWidth:0.5,
color: 'green',
rendererOptions: {animation: {speed: 1500}},
markerOptions:{color: 'green',
style:'filledSquare'},
},
//here are the series with real values - they come from php in red or orange
],
legend:{
renderer: jQuery.jqplot.EnhancedLegendRenderer,
show: true,
hideZeros: true,
location: 'e',
//labele with names
//labels: [ 'SD+4', 'SD+3', 'SD+2', 'SD+1','Perfect value', 'SD-1', 'SD-2', 'SD-3', 'SD-4', 'Real Values', 'Vales to high'],
//labele with empty points
labels: [ ' ', ' ', ' ', ' ','Perfect value', ' ', ' ', ' ', ' ', 'Real Values', 'Vales to high'],
placement: 'outsideGrid'
}
ご覧のとおり、見た目はあまり良くありません。完全な値、実際の値、および高すぎる/低すぎる値のみを表示する必要があります。