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

Error! when all value in array is zero. #648

Open
filmcup opened this issue Jul 23, 2018 · 0 comments
Open

Error! when all value in array is zero. #648

filmcup opened this issue Jul 23, 2018 · 0 comments

Comments

@filmcup
Copy link

filmcup commented Jul 23, 2018

all zero value in array i got some error "Uncaught TypeError: Cannot read property 'constructor' of null"

// sample data array
  var sample_data = [
    {"year": 1991, "name":"alpha", "value": 0},
    {"year": 1992, "name":"alpha", "value": 0},
    {"year": 1993, "name":"alpha", "value": 0},
    {"year": 1994, "name":"alpha", "value": 0},
    {"year": 1995, "name":"alpha", "value": 0}
  ]
  // instantiate d3plus
  var chartId = "chart1283";
  var visualization = d3plus.viz()
    .container("#" + chartId)  // container DIV to hold the visualization
    .data(sample_data)  // data to use with the visualization
    .type("line")       // visualization type
    .id("name")         // key for which our data is unique on
    .text("name")       // key to use for display text
    .y("value")         // key to use for y-axis
    .x("year")          // key to use for x-axis
    .height(500)
    .draw()             // finally, draw the visualization!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant