-
Notifications
You must be signed in to change notification settings - Fork 130
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
Google-chart polymer demo and web API are Okay, but ... #168
Comments
To get resizing of google-chart object to work from inside a Polymer template, I set the css of my chart div to 100% and used the IronResizeableBehavior to trigger on resize actions. One main issue was the use of "redraw" on the google-chart vs other incorrect examples online. The charts now smoothly resize to fit their responsive containers.
|
Yes, since the charts are drawn as statically sized SVGs by the Google Visualization libraries, it's not super straightforward to get resizing correct for all cases. In the case of using percentages, it's easy for a chart to not size-down or size-right depending on height, width values. If you have a demo that addresses the sizing issue nicely, I would love to see it! What do you mean about the data-binding examples? Can you elaborate more about what in the documentation is insufficient/unclear? Thanks! |
Well, I'm no expert, but it seems to me that the data binding capabilities using {{TwoWayData}} and [[OneWayData]], are really fundamental components of Polymer. Yet, the examples all show "hard-coded" data for the I think it would be nice to have a real world example. For example, charts are often plotted with dynamic data that is acquired from an ever-changing sql or json database. The data is almost never hard coded into the chart. I would imagine that one element would be the fetcher of the data and then would pass the results on to the chart element via data-binding. Because the |
Hmm... I can see what you mean but I'm not sure I totally agree. As for the "hard-coded" data. You're right. It'd be pretty rare to specify data in this way in a real application. However, this is showing exactly the format (or transformation results) the data should be in for it to work without having to follow a variable reference around. The only difference between it and real-world usage is the data would be in a property on the parent element instead of as a string in the As for loading from a URL, there are two examples of this in the demo page. One using the double array format and one using the To over-simplify using But I do plan on revamping the documentation when I get more work done on v2. The rough draft of which I'd like if you reviewed and let me know what you think. You can see the rough examples of setups there. I'd like to expand more on documenting the setups rather than each individual chart. It would be nice to use one dataset for all (or most) of the charts, making it very easy to follow (and extend). |
@wesalvaro it looks like you are making some big changes, some of which look very interesting. You mention in the draft that loading will be done through iron-ajax for example. I think providing one complete example of that would be nice and very useful for people that aren't very familiar with web development. |
It would be really nice to have a "true" Polymer example of the
google-chart
element.Specific examples of how to structure
data
,row
,column
,options
usingdata-binding
would be nice.How to make it so that charts will
size
andresize
appropriately depending on the container and with different viewports and devices, would also be nice.For example,
The text was updated successfully, but these errors were encountered: