-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-chart.series.Bar'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-chart-series-Bar'>/**
</span> * Creates a Bar Chart. A Bar Chart is a useful visualization technique to display quantitative information for
* different categories that can show some progression (or regression) in the dataset. As with all other series, the Bar
* Series must be appended in the *series* Chart array configuration. See the Chart documentation for more information.
type: 'bar',
alias: 'series.bar',
-<span id='Ext-chart.series.Bar-cfg-column'> /**
+<span id='Ext-chart-series-Bar-cfg-column'> /**
</span> * @cfg {Boolean} column Whether to set the visualization as column chart or horizontal bar chart.
*/
column: false,
-<span id='Ext-chart.series.Bar-cfg-style'> /**
+<span id='Ext-chart-series-Bar-cfg-style'> /**
</span> * @cfg style Style properties that will override the theming series styles.
*/
style: {},
-<span id='Ext-chart.series.Bar-cfg-gutter'> /**
+<span id='Ext-chart-series-Bar-cfg-gutter'> /**
</span> * @cfg {Number} gutter The gutter space between single bars, as a percentage of the bar width
*/
gutter: 38.2,
-<span id='Ext-chart.series.Bar-cfg-groupGutter'> /**
+<span id='Ext-chart-series-Bar-cfg-groupGutter'> /**
</span> * @cfg {Number} groupGutter The gutter space between groups of bars, as a percentage of the bar width
*/
groupGutter: 38.2,
-<span id='Ext-chart.series.Bar-cfg-xPadding'> /**
+<span id='Ext-chart-series-Bar-cfg-xPadding'> /**
</span> * @cfg {Number} xPadding Padding between the left/right axes and the bars
*/
xPadding: 0,
-<span id='Ext-chart.series.Bar-cfg-yPadding'> /**
+<span id='Ext-chart-series-Bar-cfg-yPadding'> /**
</span> * @cfg {Number} yPadding Padding between the top/bottom axes and the bars
*/
yPadding: 10,
return shadows;
},
-<span id='Ext-chart.series.Bar-method-drawSeries'> /**
+<span id='Ext-chart-series-Bar-method-drawSeries'> /**
</span> * Draws the series for the current chart.
*/
drawSeries: function() {
},
// @private callback used when placing a label.
- onPlaceLabel: function(label, storeItem, item, i, display, animate, index) {
+ onPlaceLabel: function(label, storeItem, item, i, display, animate, j, index) {
// Determine the label's final position. Starts with the configured preferred value but
// may get flipped from inside to outside or vice-versa depending on space.
var me = this,
text: text
});
+ label.isOutside = false;
if (column) {
if (display == outside) {
if (height + offsetY + attr.height > (yValue >= 0 ? zero - chartBBox.y : chartBBox.y + chartBBox.height - zero)) {
} else {
if (height + offsetY > attr.height) {
display = outside;
+ label.isOutside = true;
}
}
x = attr.x + groupBarWidth / 2;
else {
if (width + offsetX > attr.width) {
display = outside;
+ label.isOutside = true;
}
}
x = display == insideStart ?
}
},
-<span id='Ext-chart.series.Bar-method-getLegendColor'> /**
+<span id='Ext-chart-series-Bar-method-getLegendColor'> /**
</span> * Returns a string with the color to be used for the series legend item.
* @param index
*/
getLegendColor: function(index) {
- var me = this;
- return me.colorArrayStyle[index % me.colorArrayStyle.length];
+ var me = this,
+ colorLength = me.colorArrayStyle.length;
+
+ if (me.style && me.style.fill) {
+ return me.style.fill;
+ } else {
+ return me.colorArrayStyle[index % colorLength];
+ }
+ },
+
+ highlightItem: function(item) {
+ this.callParent(arguments);
+ this.renderLabels();
+ },
+
+ unHighlightItem: function() {
+ this.callParent(arguments);
+ this.renderLabels();
+ },
+
+ cleanHighlights: function() {
+ this.callParent(arguments);
+ this.renderLabels();
}
-});</pre></pre></body></html>
\ No newline at end of file
+});</pre>
+</body>
+</html>