isLegendHighlightedSingle function

bool isLegendHighlightedSingle(
  1. String title, {
  2. required String selectedLegend,
  3. String? activeLegend,
})

Whether title is highlighted under the single-select model.

Model B, used by HeatMapChart (HeatMapChart.tsx:608-610) and LineChart (LineChart.tsx:1817-1819): selectedLegend === legend || (selectedLegend === '' && activeLegend === legend).

The hover arm is reachable only while nothing is selected, which is what makes this model different from isLegendHighlightedMulti rather than a special case of it.

Implementation

bool isLegendHighlightedSingle(
  String title, {
  required String selectedLegend,
  String? activeLegend,
}) =>
    selectedLegend == title ||
    (selectedLegend.isEmpty && activeLegend == title);