|132972||Oct 2,2017 05:13 AM UTC||Oct 4,2017 10:07 AM UTC||Xamarin.Forms||10|
Hi Thanks so much for the reply
It seems it goes through a a random loop of all the jason data and the needle is constantly moving which is not what i was aiming for, how could you adjust this so that it only shows the latest jason data value
Hey Thanks for the quick Reply!
I believe that is the 1st data as the entry id is 1, the latest would be entry id 41 which gives a value of 18.
is there a solution to show newest value only so maybe largest entry id?
do i apply this to the last cs code you provided or the first one?
public partial class Guage2 : ContentPage
public partial class CircularGaugeGettingStartedPage : ContentPage
private const string Url = "https://thingspeak.com/channels/301726/field/1.json";
private HttpClient _client = new HttpClient();
private ObservableCollection<Feed> _data;
model = new Feed();
this.BindingContext = model;
var Value = _data[_data.Count - 1].Field1;
protected override async void OnAppearing()
content = await _client.GetStringAsync(Url);
RootObject data = JsonConvert.DeserializeObject<RootObject>(content);
_data = new ObservableCollection<Feed>(data.Feeds);
model.Min = (int)_data.Min(x => x.Field1);
model.Max = (int)_data.Max(x => x.Field1);
model.Field1 = _data.Field1;
model.Header = _data.Entry_id.ToString();
Sorry I don't quite understand where to refer the latest code snippet?
This works perfectly! Thanks
Just one more thing, just want to understand how you got it to point to the latest value
could you explain the snippet code?
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.