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
Regards
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?
Thanks
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;
Feed model;
string content;
public CircularGaugeGettingStartedPage()
{
model = new Feed();
this.BindingContext = model;
InitializeComponent();
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[0].Field1;
model.Header = _data[0].Entry_id.ToString();
base.OnAppearing();
}
}
}
}
Hey
Sorry I don't quite understand where to refer the latest code snippet?
Thanks
Kind Regards
Hi
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?
Thanks