[英]Legend not showing all series in LightningChart JS
我建議嘗試使用水平 LegendBox 和垂直 LegendBox 構建器。 您可以通過在 LegendBox 創建期間傳遞LegendBoxBuilder來完成此操作
// Align legendBox entries vertically, with groups aligned horizontally
const legendBox = chart.addLegendBox( LegendBoxBuilders.HorizontalLegendBox )
// Align legendBox entries horizontally, with groups aligned vertically
const legendBox = chart.addLegendBox( LegendBoxBuilders.VerticalLegendBox )
如果這還不夠,您還可以嘗試在圖例框中對系列進行分組,這樣它們就不會在圖表區域之外對齊。
// Add a series to a legendBox, attach it to a specific group
legendBox.add(
// Series to attach to the legendBox.
series1,
// Boolean to set if clicking on the checkbox should hide/show the series attached.
true,
// Group name the entry should be grouped under; if no group with the name exists, it is created. If left empty, entry will be grouped under 'undefined group'.
'Group 1'
)
// Add a series to a legendBox, set it to a second group
legendBox.add(
series6,
true,
'Group 2'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.