Hi all,
I got an issue regarding data query implementation in the predix ui-seed app.
I want to implement a line chart, that shows the data, In the blankpage-view.html in the path predix-seed/public/elements/views I added the following:
<px-simple-line-chart width="auto"
min="0.5" max="3.0"
columns="5" rows="3"
line-data='[[1397102460000,1.99],[1397139660000,1.92],[1397177400000,1.97],
[1397228040000,1.12]]'
threshold="1.8"
min-label="min"
max-label="max">
</px-simple-line-chart>
But in this example, the Data is given to the line chart via hard code - how do I implement the data query from the view-service?
I found ([here][1]) a method to query the data with a GET request - but in which file do I put this?
this.getData('http://weather.com/sanramon', {headers: {'my-header-name': 'my-header-value'}}).then(function(data) {
// on fulfillment
self.currentTemperature = data.value;
}, function(reason) {
// on rejection
console.error('ERROR', reason);
});
and is this the right code? In which file is it supposed to go? (predix-seed/public/bower_components/px-sample-cards/time-series-card.html maybe?) And what part of the code is supposed to go in the
Answer by Greg Stroup · Nov 21, 2016 at 08:35 AM
We're working on adding some sample code for that now. At the moment, it's on a branch in the predix-seed:
https://github.com/PredixDev/predix-seed/tree/microservice-integration
Take a look at the winddata-view.html file. It shows how to call mock data, time series directly, and a custom wind data microservice.