1 <!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.Callout'>/**
2 </span> * @class Ext.chart.Callout
5 Ext.define('Ext.chart.Callout', {
7 /* Begin Definitions */
11 constructor: function(config) {
12 if (config.callouts) {
13 config.callouts.styles = Ext.applyIf(config.callouts.styles || {}, {
14 color: "#000",
15 font: "11px Helvetica, sans-serif"
17 this.callouts = Ext.apply(this.callouts || {}, config.callouts);
18 this.calloutsArray = [];
22 renderCallouts: function() {
29 animate = me.chart.animate,
31 styles = config.styles,
32 group = me.calloutsArray,
33 store = me.chart.store,
34 len = store.getCount(),
35 ratio = items.length / len,
36 previouslyPlacedCallouts = [],
42 for (i = 0, count = 0; i < len; i++) {
43 for (j = 0; j < ratio; j++) {
44 var item = items[count],
46 storeItem = store.getAt(i),
49 display = config.filter(storeItem);
51 if (!display && !label) {
57 group[count] = label = me.onCreateCallout(storeItem, item, i, display, j, count);
60 if (label[p] && label[p].setAttributes) {
61 label[p].setAttributes(styles, true);
67 if (label[p].setAttributes) {
68 label[p].setAttributes({
71 } else if(label[p].setVisible) {
72 label[p].setVisible(false);
77 config.renderer(label, storeItem);
78 me.onPlaceCallout(label, storeItem, item, i, display, animate,
79 j, count, previouslyPlacedCallouts);
80 previouslyPlacedCallouts.push(label);
84 this.hideCallouts(count);
87 onCreateCallout: function(storeItem, item, i, display) {
89 group = me.calloutsGroup,
91 styles = config.styles,
93 height = styles.height,
95 surface = chart.surface,
102 calloutObj.lines = surface.add(Ext.apply({},
106 stroke: me.getLegendColor() || '#555'
111 calloutObj.panel = Ext.create('widget.panel', {
112 style: "position: absolute;",
123 hideCallouts: function(index) {
124 var calloutsArray = this.calloutsArray,
125 len = calloutsArray.length,
128 while (len-->index) {
129 co = calloutsArray[len];
138 </pre></pre></body></html>