icedek icedek - 6 months ago 47
AngularJS Question

nvd3 Box Plot with Dates

I'm trying to get a box plot going where my Y axis is going to be Dates. I have tried to strip down to the bare minimum and I only see "No Data Available".

Here is the plunker

$scope.data = [{
label: "Sample A",
values: {
Q1: new Date(),
Q2: new Date()
}
},
];


I just want to see some Dates and I can go forward from there.

Thanks!

Answer

You have to specify Q3 too.

$scope.data = [{
     label: "Sample A",
     values: {
         Q1: new Date(),
         Q2: new Date(),
         Q3: new Date()
     }
}];

It's because nvd3 boxplot use the first quartile, the mediam (Q2), and the third quartile.

Here is a working example