-
Notifications
You must be signed in to change notification settings - Fork 607
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
Vega-lite graph generated from view API is getting cut off #7096
Comments
Odd. Can you try passing numbers as numbers to the view api (not quoted)? |
I copy pasted the JSON as is into the array section and the result is the same. I have other graphs as well, and they are truncated differently, some just lose the x and y-axis labels while the one in the picture loses pretty much everything except 1 bar. |
If you miss the labels, you might need to call .resize on the view after you insert data. It's to recalculate padding. |
That works! Thank you! |
You can also set autosize.resize to true. See https://vega.github.io/vega-lite/docs/size.html#autosize. We should document more explicitly that resize is false and how to trigger a resize event. |
Done in #7097 |
Hi,
I have created vega-lite graphs using the view API. My general procedure is to pull data from a database and place it into a JSON array and then feed the array to the vega view api to push to my graph and construct it. It works as desired, however parts of my graph get cut of, or I simply get a really truncated graph, which is not the case for when I pull the graph data from a csv or json file locally. I have attempted a couple things, but nothing is working and the graphs are arbitrarily cut. I attempted to place the actual json below in the array section of the "view.insert" code below but it did not work either, I still get a truncated graph. The only way right now to get the full graph is to use data from a csv locally. I am kind of lost as to what to do or why this is happening.
The script to push the above array to the graph.
Below is a picture of the graphs. The top one is created by data fetched from the DB and pushed via the view API, while the bottom one is created by using a csv or json locally.
The text was updated successfully, but these errors were encountered: