Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label sorting error #134

Open
jhmullen opened this issue Nov 8, 2019 · 0 comments
Open

Label sorting error #134

jhmullen opened this issue Nov 8, 2019 · 0 comments
Labels

Comments

@jhmullen
Copy link

jhmullen commented Nov 8, 2019

Expected Behavior

I want to set the label key of a d3plus viz config.

Current Behavior

Getting the following error:

Viz.js:347 Uncaught TypeError: _this._drawLabel(...).localeCompare is not a function
    at Viz._this._legendSort (Viz.js:347)
    at Array.sort (<anonymous>)
    at LinePlot._default (_drawLegend.js:86)
    at LinePlot._draw (Viz.js:647)
    at LinePlot._draw (Plot.js:905)
    at Queue.eval [as _call] (Viz.js:866)
    at maybeNotify (queue.js:137)
    at eval (queue.js:99)
    at eval (load.js:108)
    at Object.eval (request.js:118)

Steps to Reproduce (for bugs)

Use the following config:

{
  "data": `https://api.datamexico.org/tesseract/data.jsonrecords?cube=inegi_enoe&Industry%20Group=6221&Quarter=20182,20183,20184,20191,20192&drilldowns=Occupation,Quarter&measures=Workforce,Wage&parents=true&sparse=false&locale=es`,
  "type": "LinePlot",
  "groupBy": "Occupation ID",  
  "label": d => d["Occupation"],
  "x": "Year",
  "y": "Wage",
  "xConfig" : {"title": "Year"},
  "yConfig" : {"title": "Wage"},
  "title": "Wages by Occupation",
  "tooltipConfig": {
    "tbody": [
      ["Year", d => d["Year"]],["Wage", d => d["Wage"]]
    ]
  }
}

Notes

You can fix this by changing "label": d => d["Occupation"], to "label": d => `${d["Occupation"]}`,

@davelandry davelandry added the bug label Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants