question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

legendDataForKeys() missing data

See original GitHub issue
 var legendDataForKeys = result.bars.filter(function (bar) {
        return bar.data.index === 0;
    }).map(function (bar) {
        return {
            label: bar.data.id,
            fill: bar.data.fill ? bar.data.fill : bar.color
        };
    }).reverse();

Consider following data:

[
  {
    key1: 0,
    key2: 100,
    key3: 100,
    idx: 0
  },
  {
    key1:100,
    key2:300,
    key3:400,
    idx:1
  }
]

Key1 would be missed in legendDataForKeys, as it seems that result.bars only contains those that have visible heights?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
stahlmanDesigncommented, Dec 21, 2017

You guys are right, it only shows legends for the first bar. If that stacked bar only has 1 colour, then the legend only has one item. legend-keys

0reactions
plingampallycommented, Nov 6, 2018

@stahlmanDesign Fix does work but it produces console log errors, as the data structure has changed.

The object should look like this:

var legendDataForKeys = result.bars.map(function (bar) {
   return {
     id: bar.data.id,
     label: bar.data.id,
     color: bar.color,
     fill: bar.data.fill ? bar.data.fill : bar.color
   };
 }).reverse();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing data and multiple imputation - PubMed
Abstract. Missing data can result in biased estimates of the association between an exposure X and an outcome Y. Even in the absence...
Read more >
Working with missing data — pandas 1.5.2 documentation
To make detecting missing values easier (and across different array dtypes), pandas provides the isna() and notna() functions, which are also methods on ......
Read more >
Missing data
Identify missing values within each variable. Look for patterns of missingness. Check for associations between missing and observed data. Decide how to handle ......
Read more >
Missing Values | Stata Learning Modules - OARC Stats - UCLA
Missing Values | Stata Learning Modules. 1. Introduction. This module will explore missing data in Stata, focusing on numeric missing data. It will...
Read more >
Dealing with missing data: Key assumptions and methods for ...
Methods for handling missing data . ... the missing data mechanisms and the patterns of missingness, ... We also specify the rseed() option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found