mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Add highlight of current plotted attribute
Change chart line color to blue.
This commit is contained in:
parent
eb3a47a622
commit
9fdeeb2719
4 changed files with 30 additions and 5 deletions
|
@ -3,10 +3,13 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
tagName: 'div',
|
||||
classNames: ['layout-page'],
|
||||
currentProperty: null,
|
||||
|
||||
visibleProperty: function() {
|
||||
var properties = this.get('entity.properties');
|
||||
return properties.objectAt(0);
|
||||
var prop = properties.objectAt(0);
|
||||
this.setCurrentProperty(prop);
|
||||
return prop;
|
||||
}.property('entity'),
|
||||
|
||||
entityAvailable: function() {
|
||||
|
@ -18,9 +21,19 @@ export default Ember.Component.extend({
|
|||
}
|
||||
}.property('entity'),
|
||||
|
||||
setCurrentProperty: function(property) {
|
||||
if (this.currentProperty) {
|
||||
this.currentProperty.set('visible', false);
|
||||
}
|
||||
|
||||
this.currentProperty = property;
|
||||
this.currentProperty.set('visible', true);
|
||||
},
|
||||
|
||||
actions: {
|
||||
showPropertyValues(_prop) {
|
||||
this.set('visibleProperty', _prop);
|
||||
this.setCurrentProperty(_prop);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -39,7 +39,12 @@ export default Ember.Component.extend({
|
|||
lastTimestamp = +firstTimestamp + +diffValue;
|
||||
}
|
||||
|
||||
$.plot('#' + element.id, [this.data], {
|
||||
$.plot('#' + element.id, [
|
||||
{
|
||||
data: this.data,
|
||||
color: "rgb(51, 102, 204)"
|
||||
}
|
||||
], {
|
||||
xaxis: {
|
||||
mode: 'time',
|
||||
timeformat: '%M:%S',
|
||||
|
|
|
@ -94,7 +94,6 @@ export default DS.RESTSerializer.extend({
|
|||
|
||||
if (timestamp === 0) {
|
||||
timestamp = (new Date()).getTime();
|
||||
console.log('Use local timestamp');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Attributes</th>
|
||||
</tr>
|
||||
{{#each model.properties as |property|}}
|
||||
<tr>
|
||||
<td><a href="#" {{action "propertyClicked" property}}>{{property.name}}</a></td>
|
||||
<td>
|
||||
<a href="#" {{action "propertyClicked" property}}>
|
||||
{{#if property.visible}}
|
||||
<strong>{{property.name}}</strong>
|
||||
{{else}}
|
||||
{{property.name}}
|
||||
{{/if}}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
|
Loading…
Add table
Reference in a new issue