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

How do I convert an array of values so that they are correctly understood by display()? #34

Open
pachecolp opened this issue Jun 10, 2018 · 0 comments

Comments

@pachecolp
Copy link

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.

@pachecolp pachecolp changed the title How do I convert a values so that they are correctly understood by display()? How do I convert an array of values so that they are correctly understood by display()? Jun 10, 2018
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