You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2022/03/16 12:50:25 UTC
[isis] branch ISIS-2957 updated: ISIS-2957 add legend to EventBubbleChart
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2957
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/ISIS-2957 by this push:
new 16be0bc ISIS-2957 add legend to EventBubbleChart
16be0bc is described below
commit 16be0bc6118fb848c55ad67ccbcc343832382ffc
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Mar 16 13:50:01 2022 +0100
ISIS-2957 add legend to EventBubbleChart
---
.../client/kroviz/ui/panel/EventBubbleChart.kt | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventBubbleChart.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventBubbleChart.kt
index 9358fe7..a400cbe 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventBubbleChart.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventBubbleChart.kt
@@ -71,7 +71,8 @@ class EventBubbleChart() : SimplePanel() {
text = listOf<String>("Request Duration over Time by Request Density and Response Size"),
display = true
),
- tooltip = TooltipOptions(callbacks = toolTipCallback())
+ tooltip = TooltipOptions(callbacks = toolTipCallback()),
+ legend = buildLegend()
),
onClick = js(
"function(e) {"
@@ -190,14 +191,23 @@ class EventBubbleChart() : SimplePanel() {
return labelList
}
- private fun buildLegendLabelOptions(): LegendLabelOptions {
- val legend = LegendLabelOptions()
- legend.generateLabels?.invoke() {
-
- }
+ private fun buildLegend(): LegendOptions {
+ val legend = LegendOptions(
+ display = true,
+ position = Position.RIGHT,
+ labels = buildLegendLabelOptions(),
+ title = LegendTitleOptions(text = "title here")
+ )
return legend
}
+ private fun buildLegendLabelOptions(): LegendLabelOptions {
+ val legendLabelOptions = LegendLabelOptions(
+ color = EventBubbleChart.YELLOW //mutableListOf(DARK_BLUE, LIGHT_BLUE, GREEN, YELLOW, RED, RED_VIOLET, VIOLET)
+ )
+ return legendLabelOptions
+ }
+
private fun generateLabels(): List<LegendItem> {
return mutableListOf<LegendItem>()
}