Greg
12/14/2025, 10:34 PMcolor("Metric")
type( "Metric")
... i get 2 separate legends, one showing colours and the other line types (in this particular case, "Metric" only ever has 2 values, and in reality, i use categorical to determine which one gets a dashed line, whereas i currently keep the default colour mappings... while i can turn off the legend for line types, the one remaining for colours is useful, but looks wrong since the "blue" line appears solid in the legend)Andrei Kislitsyn
12/15/2025, 9:58 AMGreg
12/16/2025, 12:43 AMval dirPlot = allData
.select("Period", "Unfiltered", "Filtered")
.gather("Unfiltered", "Filtered").into("Metric", "Value")
.plot {
layoutWithHorizontalTopLeftLegend("My title")()
line {
x("Period"){
axis.name = ""
}
y("Value") {
axis.name = "%"
scale = continuous(0..100)
}
color("Metric") {
legend.name = "" // The legend title is the column name by default, which isn't useful here ("Metric")
}
type( "Metric") {
scale = categorical("Unfiltered" to LineType.DASHED, "Filtered" to LineType.SOLID)
legend {
type = LegendType.None
}
}
tooltips(enable = true)
}
}Greg
12/16/2025, 12:47 AMAndrei Kislitsyn
12/16/2025, 8:29 AMAndrei Kislitsyn
12/16/2025, 8:30 AMtype legend.Greg
12/16/2025, 9:03 PMGreg
12/16/2025, 9:10 PMlayout {
style {
legend {
title {
blank = true
...
which leaves the plots a little cleaner (i'm reusing a function for layouts across several plots) but of course only makes sense if i can dispense of all legend titles in the given plotGreg
12/16/2025, 9:14 PMAndrei Kislitsyn
12/17/2025, 11:35 AMAndrei Kislitsyn
12/17/2025, 11:36 AM