How to get Data from Legend

Certified Associate Developer

Hi,

I want to be able to unselected all the labels that appears in the legend by using a button or any other way.

I do not know how to have access to the variable that store a value to know if the label has been selected or unselected. For example, in the first picture there is only 3 label selected, so the graphic show the 3 data lines, every one related to its own label. In the second one, one of the label has been unselected, so the data related to this one does not appear in the graphic. I would like to know how to have access to this parameter so I could make this change without the needing of clicking the label directly.

 VS 

Thanks in advance.

PS: here the piece of code that define the linechart, if it is helpfull.

a!lineChartField(
label: "Forecast",
labelPosition: "ABOVE",
categories: { union(local!data.date, local!data.date) },
series: {
a!forEach(
items: union(
local!data.consumable,
local!data.consumable
),
expression: {
a!chartSeries(
label: fv!item,
data: index(
local!data,
wherecontains(fv!item, local!data.consumable)
).count
)
}
)
},
xAxisTitle: "Meses",
yAxisTitle: "Nº Pedidos",
showLegend: true,
showDataLabels: false,
showTooltips: true,
allowDecimalAxisLabels: false,
connectNulls: false,
colorScheme: "PARACHUTE",
height: "TALL",
xAxisStyle: "STANDARD",
yAxisStyle: "STANDARD"
)

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to rmoreno

    a!paragraphField(
                          label: tostring(
                           a!lineChartField(
    label: "Forecast",
    labelPosition: "ABOVE",
    categories: { union(local!data.date, local!data.date) },
    series: {
    a!forEach(
    items: union(
    local!data.consumable,
    local!data.consumable
    ),
    expression: {
    a!chartSeries(
    label: fv!item,
    data: index(
    local!data,
    wherecontains(fv!item, local!data.consumable)
    ).count
    )
    }
    )
    },
    xAxisTitle: "Meses",
    yAxisTitle: "Nº Pedidos",
    showLegend: true,
    showDataLabels: false,
    showTooltips: true,
    allowDecimalAxisLabels: false,
    connectNulls: false,
    colorScheme: "PARACHUTE",
    height: "TALL",
    xAxisStyle: "STANDARD",
    yAxisStyle: "STANDARD"
    )
                          )
                        )

    Please paste this code, you will able to find the long text and also able to find the those labels. 

  • 0
    Certified Lead Developer
    in reply to aditya007

    Can you clarify in what way this answers the original question?  I don't see anything in additional pertaining to the built-in chart filtering done via clicking on the legend data, which I still believe isn't accessible from the designer's perspective.