pixiedust_node
pixiedust_node copied to clipboard
How do I convert an array of values so that they are correctly understood by `display()`?
I'm new to Jupyter and pixiedust and I'm having a hardtime on my first experiments with it.
I'm looping through an array to recover values by time stamp and put them in a new array to be displayed as a line graph.
var data = [];
body.donors.forEach(
function(donor) {
var epochDate = new Date(donor.data_envio).setHours(0,0,0,0);
var obj = {
date: new Date(epochDate),
valor: Number(donor.valor)
};
data.push(obj);
}
);
display(data);
When I do this, the generated chart says "x must be a label or position".
Opening "Options", the date field is shown as "string".
I've tried formating the date field as ISO 8601 but it is still understood as string.
I've found no information/documentation on how to "cast" my data so that pixiedust correctly understands it.