Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
edfungus committed Mar 13, 2016
2 parents 71f3585 + ce4ad65 commit 6f5cf91
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 14 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,57 @@ Example:
}
```

### Line Chart

![Crouton-chart-line](https://raw.githubusercontent.com/edfungus/Crouton/master/public/common/images/crouton-chart-line.png)

</br> A simple line chart with multiple lines available. The *labels* corresponds to the x axis values and the *series* corresponds to the y axis values. Multiple sets of (x,y) values can be passed at once as long as the array length of labels and series are matched. The reason why series is multidimensional is so that multiple lines can be drawn where each array in series corresponds to a line. The *update* parameter is expected on update and holds a copy of *values* with the new *labels* and *series* within. *Max* refers to the maximum number of data points based on the x axis is shown. *low* and *high* refers to the maximum y values expected.

*It is suggested that labels and series be prepopulated with one set of (x,y) value for each line*

```json
Device -> Crouton
Name: crouton-chart-line

Example:
"temperature": {
"values": {
"labels": [1], [required]
"series": [[60]], [required]
"update": null [required]
},
"max": 11, [required]
"low": 58, [required]
"high": 73, [required]
"card-type": "crouton-chart-line", [required]
"title": "Temperature (F)" [optional]
}

3 lines and 1 value:
"values": {
"labels": [1],
"series": [[60],[2],[543]],
"update": null
}

3 lines and 2 values:
"values": {
"labels": [1,2],
"series": [[60,62],[2,4],[543,545]],
"update": null
}

To update temperature:
"values": {
"labels": null,
"series": null,
"update": {
"labels" : [2],
"series": [[62]]
}
}
```


## Advanced cards

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"paper-header-panel": "PolymerElements/paper-header-panel#~1.0.5",
"paper-input": "PolymerElements/paper-input#~1.0.15",
"paper-button": "PolymerElements/paper-button#~1.0.8",
"paper-styles": "PolymerElements/paper-styles#~1.0.11",
"paper-styles": "PolymerElements/paper-styles#~1.1.4",
"iron-form": "PolymerElements/iron-form#~1.0.9",
"paper-toast": "PolymerElements/paper-toast#~1.0.0",
"packery": "~1.4.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ dom-module(id="crouton-chart-donut")
}
});
//Reupdate chart so that it will fit correctly
// this.async(function(){
// that.chart.update();
// },100);
this.async(function(){
that.chart.update();
},200);
},
newValues: function(changeRecord){
if(this.endPointJson.centerSum && Array.isArray(this.endPointJson.values.series)){
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ crouton-simple-toggle{
--paper-toggle-button-checked-button-color: @button-normal;

.toggle-container.paper-toggle-button {
margin-left: auto;
margin-right: auto;
margin-left: auto !important;
margin-right: auto !important;
padding-left: 2px;
}
}

Expand Down
51 changes: 51 additions & 0 deletions public/app/documentation/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,57 @@ Example:
}
```

### Line Chart

![Crouton-chart-line](/static/common/images/crouton-chart-line.png)

</br> A simple line chart with multiple lines available. The *labels* corresponds to the x axis values and the *series* corresponds to the y axis values. Multiple sets of (x,y) values can be passed at once as long as the array length of labels and series are matched. The reason why series is multidimensional is so that multiple lines can be drawn where each array in series corresponds to a line. The *update* parameter is expected on update and holds a copy of *values* with the new *labels* and *series* within. *Max* refers to the maximum number of data points based on the x axis is shown. *low* and *high* refers to the maximum y values expected.

*It is suggested that labels and series be prepopulated with one set of (x,y) value for each line*

```json
Device -> Crouton
Name: crouton-chart-line

Example:
"temperature": {
"values": {
"labels": [1], [required]
"series": [[60]], [required]
"update": null [required]
},
"max": 11, [required]
"low": 58, [required]
"high": 73, [required]
"card-type": "crouton-chart-line", [required]
"title": "Temperature (F)" [optional]
}

3 lines and 1 value:
"values": {
"labels": [1],
"series": [[60],[2],[543]],
"update": null
}

3 lines and 2 values:
"values": {
"labels": [1,2],
"series": [[60,62],[2,4],[543,545]],
"update": null
}

To update temperature:
"values": {
"labels": null,
"series": null,
"update": {
"labels" : [2],
"series": [[62]]
}
}
```


## Advanced cards

Expand Down
Loading

0 comments on commit 6f5cf91

Please sign in to comment.