@anujtroy First I’d suggest considering if you need all the text. The labels for a chart should be easy to read on a glance. With values that are in the thousands, you probably don’t need to also show four decimal places. The project for example trims off the precipitation to one decimal place. You could likely just show the whole number and better convey the information.
If you still see the wrapping, then you will likely need to add .fixedSize() and/or .frame() attributes to give the framework a better idea of the size of the contents. Something like the following though you numbers likely will be different:
There is an annoying bug in this application related to navigation: select one of the locations in the first view, then go back. Try selecting the same location again and it won’t navigate to it anymore.
I really enjoyed this tutorial and I would like to access the NOAA data for an another function but am totally confused on how the api for the daily summary works. Can you provide the code you used to get the sample data? Thanks.
Unfortunately I have no code to share. I pulled the data for this tutorial using the tools at the site referenced in the app as a CSV file. Then I pulled it into a spreadsheet to remove the data that I didn’t need.
Thanks for the tutorial. I have a question:
What if I have very different values. For example data for every day of a week:
For the largest value (12000) the bar is to high and for the smallest value (2) the bar is to low.
How can i display this different values in a readable chart?
@thbi For data like this, you might want to look at a logarithmic scale. Implementing that is a bit complex, but the idea is you’d have something like 1, 2, 3, etc. as the y-axis, but the values would really be 10^1, 10^2, 10^3, etc. You’d need to use the log10() method in Foundation to do the conversion.