質問
extjs 5チャートにlegend
を追加しようとしています。これはバグですか、それとも間違っていることをしていますか?
legend: {
docked: 'top',
style: {
borderColor: 'red',
borderStyle: 'solid'
}
}
. 解決
私はしばらくの間この同じ問題に取り組んでいました - そしてついにSenchaバグレポートを提出しました:
http://www.sencha。COM / FORUM / SHOWTHREAD.PHP?289279 - Sencha-5チャート壊れた凡例
ロングストーリーの短い、次のEXTJSロールアウトに「おそらく」修正があります。残念ながら、それは今私たちを助けません...
legend: {
docked: 'top',
border: 0,
style: { borderColor: 'red' },
tpl: [
'<tpl for=".">',
'<div class="myLegendItem" style="float:left;margin:5px;padding:0px;cursor:pointer;">',
'<div class="" style="float:left;margin:2px;width:10px;height: 10px; background:{mark};opacity:.6"></div><div style="float:left;">{name}</div>',
'</div>',
'</tpl>'
],
itemSelector: '.myLegendItem'
},
. 他のヒント
凡例の非アクティブなシリーズをマスクするには、3ounary演算子を使用して値を確認します.disabled
<div class="x-legend-container">
<tpl for=".">
<div class="x-legend-item {[ values.disabled ? Ext.baseCSSPrefix + 'legend-inactive' : '' ]}">
<span class="x-legend-item-marker" style="background:{mark};float:left;width:10px;height:10px;"></span>
<span style="float:left;margin-left:4px;">{name}</span>
</div>
</tpl>
</div>
.
必要に応じて
にCSSクラスを追加する場合x-legend-inactive{
opacity: 0.5;
}
. 所属していません StackOverflow