Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Adding support for horizontalBar chart [51]
Browse files Browse the repository at this point in the history
added chart-horizontal-bar for horizontal bar charts
  • Loading branch information
Stormsys committed Jun 24, 2016
2 parents bbcdb21 + a35100d commit 085ae52
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions chart-elements.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<link rel="import" href="chart-bar.html">
<link rel="import" href="chart-doughnut.html">
<link rel="import" href="chart-horizontal-bar.html">
<link rel="import" href="chart-line.html">
<link rel="import" href="chart-pie.html">
<link rel="import" href="chart-polar-area.html">
Expand Down
76 changes: 76 additions & 0 deletions chart-horizontal-bar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html">
<link rel="import" href="chart-js-import.html">
<link rel="import" href="chart-property-behavior.html">
<link rel="import" href="context-behavior.html">
<link rel="import" href="resize-behavior.html">

<!--
A bar chart is a way of showing data as bars.
It is sometimes used to show trend data, and the comparison of multiple data sets side by side.
##### Example
<chart-horizontal-bar data="[[data]]"></chart-horizontal-bar>
...
this.data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
backgroundColor: "rgba(220,220,220,0.2)",
borderColor: "rgba(220,220,220,1)",
borderWidth: 1,
data: [65, 59, 80, 81, 56, 55, 40]
},
{
label: "My Second dataset",
backgroundColor: "rgba(151,187,205,0.2)",
borderColor: "rgba(151,187,205,1)",
borderWidth: 1,
data: [28, 48, 40, 19, 86, 27, 90]
}
]
};
@group Chart Elements
@element chart-bar
@demo demo/chart-bar.html
-->

<link rel="import" href="chart-styles.html">
<dom-module id="chart-horizontal-bar">

<template>

<style include="chart-styles"></style>

<div>
<canvas id="canvas"></canvas>
</div>

</template>

<script>
Polymer({

is: 'chart-horizontal-bar',

behaviors: [
Polymer.IronResizableBehavior,
ChartBehaviors.ChartPropertyBehavior,
ChartBehaviors.ContextBehavior,
ChartBehaviors.ResizeBehavior
],

ready: function() {
this._setType('horizontalBar');
}

});
</script>

</dom-module>

0 comments on commit 085ae52

Please sign in to comment.