/**
* @class Ext.chart.Callout
* A mixin providing callout functionality for Ext.chart.series.Series.
*/
Ext.define('Ext.chart.Callout', {
/* Begin Definitions */
/* End Definitions */
constructor: function(config) {
if (config.callouts) {
config.callouts.styles = Ext.applyIf(config.callouts.styles || {}, {
color: "#000",
font: "11px Helvetica, sans-serif"
});
this.callouts = Ext.apply(this.callouts || {}, config.callouts);
this.calloutsArray = [];
}
},
renderCallouts: function() {
if (!this.callouts) {
return;
}
var me = this,
items = me.items,
animate = me.chart.animate,
config = me.callouts,
styles = config.styles,
group = me.calloutsArray,
store = me.chart.getChartStore(),
len = store.getCount(),
ratio = items.length / len,
previouslyPlacedCallouts = [],
i,
count,
j,
p,
item,
label,
storeItem,
display;
for (i = 0, count = 0; i < len; i++) {
for (j = 0; j < ratio; j++) {
item = items[count];
label = group[count];
storeItem = store.getAt(i);
display = (!config.filter || config.filter(storeItem));
if (!display && !label) {
count++;
continue;
}
if (!label) {
group[count] = label = me.onCreateCallout(storeItem, item, i, display, j, count);
}
for (p in label) {
if (label[p] && label[p].setAttributes) {
label[p].setAttributes(styles, true);
}
}
if (!display) {
for (p in label) {
if (label[p]) {
if (label[p].setAttributes) {
label[p].setAttributes({
hidden: true
}, true);
} else if(label[p].setVisible) {
label[p].setVisible(false);
}
}
}
}
if (config && config.renderer) {
config.renderer(label, storeItem);
}
me.onPlaceCallout(label, storeItem, item, i, display, animate,
j, count, previouslyPlacedCallouts);
previouslyPlacedCallouts.push(label);
count++;
}
}
this.hideCallouts(count);
},
onCreateCallout: function(storeItem, item, i, display) {
var me = this,
group = me.calloutsGroup,
config = me.callouts,
styles = (config ? config.styles : undefined),
width = (styles ? styles.width : 0),
height = (styles ? styles.height : 0),
chart = me.chart,
surface = chart.surface,
calloutObj = {
//label: false,
//box: false,
lines: false
};
calloutObj.lines = surface.add(Ext.apply({},
{
type: 'path',
path: 'M0,0',
stroke: me.getLegendColor() || '#555'
},
styles));
if (config.items) {
calloutObj.panel = new Ext.Panel({
style: "position: absolute;",
width: width,
height: height,
items: config.items,
renderTo: chart.el
});
}
return calloutObj;
},
hideCallouts: function(index) {
var calloutsArray = this.calloutsArray,
len = calloutsArray.length,
co,
p;
while (len-->index) {
co = calloutsArray[len];
for (p in co) {
if (co[p]) {
co[p].hide(true);
}
}
}
}
});
/**
* A composite Sprite handles a group of sprites with common methods to a sprite
* such as `hide`, `show`, `setAttributes`. These methods are applied to the set of sprites
* added to the group.
*
* CompositeSprite extends {@link Ext.util.MixedCollection} so you can use the same methods
* in `MixedCollection` to iterate through sprites, add and remove elements, etc.
*
* In order to create a CompositeSprite, one has to provide a handle to the surface where it is
* rendered:
*
* var group = Ext.create('Ext.draw.CompositeSprite', {
* surface: drawComponent.surface
* });
*
* Then just by using `MixedCollection` methods it's possible to add {@link Ext.draw.Sprite}s:
*
* group.add(sprite1);
* group.add(sprite2);
* group.add(sprite3);
*
* And then apply common Sprite methods to them:
*
* group.setAttributes({
* fill: '#f00'
* }, true);
*/
Ext.define('Ext.draw.CompositeSprite', {
/* Begin Definitions */
extend: 'Ext.util.MixedCollection',
mixins: {
animate: 'Ext.util.Animate'
},
autoDestroy: false,
/* End Definitions */
isCompositeSprite: true,
/**
* @event
* @inheritdoc Ext.draw.Sprite#mousedown
*/
/**
* @event
* @inheritdoc Ext.draw.Sprite#mouseup
*/
/**
* @event
* @inheritdoc Ext.draw.Sprite#mouseover
*/
/**
* @event
* @inheritdoc Ext.draw.Sprite#mouseout
*/
/**
* @event
* @inheritdoc Ext.draw.Sprite#click
*/
constructor: function(config) {
var me = this;
Ext.apply(me, config);
me.id = Ext.id(null, 'ext-sprite-group-');
me.callParent();
},
// @private
onClick: function(e) {
this.fireEvent('click', e);
},
// @private
onMouseUp: function(e) {
this.fireEvent('mouseup', e);
},
// @private
onMouseDown: function(e) {
this.fireEvent('mousedown', e);
},
// @private
onMouseOver: function(e) {
this.fireEvent('mouseover', e);
},
// @private
onMouseOut: function(e) {
this.fireEvent('mouseout', e);
},
attachEvents: function(o) {
var me = this;
o.on({
scope: me,
mousedown: me.onMouseDown,
mouseup: me.onMouseUp,
mouseover: me.onMouseOver,
mouseout: me.onMouseOut,
click: me.onClick
});
},
// Inherit docs from MixedCollection
add: function(key, o) {
var result = this.callParent(arguments);
this.attachEvents(result);
return result;
},
insert: function(index, key, o) {
return this.callParent(arguments);
},
// Inherit docs from MixedCollection
remove: function(o) {
var me = this;
o.un({
scope: me,
mousedown: me.onMouseDown,
mouseup: me.onMouseUp,
mouseover: me.onMouseOver,
mouseout: me.onMouseOut,
click: me.onClick
});
return me.callParent(arguments);
},
/**
* Returns the group bounding box.
* Behaves like {@link Ext.draw.Sprite#getBBox} method.
* @return {Object} an object with x, y, width, and height properties.
*/
getBBox: function() {
var i = 0,
sprite,
bb,
items = this.items,
len = this.length,
infinity = Infinity,
minX = infinity,
maxHeight = -infinity,
minY = infin
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Extjs5官方可运行实例Ticket App (7558个子文件)
validData.amf 771B
amf0-all.amf 457B
amf3-all.amf 328B
amf0-records.amf 129B
amf3-records.amf 84B
empty.amf 0B
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 2KB
sencha.cfg 1KB
sencha.cfg 1KB
sencha.cfg 475B
ext-theme-neptune-touch-all-rtl-debug_01.css 898KB
ext-theme-neptune-all-rtl-debug_01.css 898KB
ext-theme-classic-sandbox-all-rtl-debug.css 895KB
ext-theme-neptune-touch-all-debug_01.css 893KB
ext-theme-neptune-all-debug_01.css 893KB
ext-theme-classic-all-rtl-debug.css 888KB
ext-theme-gray-all-rtl-debug.css 878KB
ext-theme-crisp-touch-all-rtl-debug_01.css 858KB
ext-theme-crisp-all-rtl-debug_01.css 858KB
ext-theme-crisp-all-debug.css 850KB
ext-theme-crisp-touch-all-debug.css 850KB
ext-theme-classic-sandbox-all-debug.css 841KB
ext-theme-classic-all-debug.css 834KB
ext-theme-gray-all-debug.css 826KB
ext-theme-classic-sandbox-all-rtl.css 362KB
ext-theme-neptune-touch-all_01.css 357KB
ext-theme-neptune-touch-all-rtl_01.css 357KB
ext-theme-neptune-all_01.css 357KB
ext-theme-neptune-all-rtl_01.css 356KB
ext-theme-classic-all-rtl.css 355KB
ext-theme-gray-all-rtl.css 345KB
ext-theme-classic-sandbox-all.css 329KB
ext-theme-classic-all.css 324KB
ext-theme-crisp-touch-all-rtl_01.css 321KB
ext-theme-crisp-all-rtl_01.css 321KB
ext-theme-crisp-all.css 319KB
ext-theme-crisp-touch-all.css 319KB
ext-theme-gray-all.css 314KB
ext-theme-neptune-touch-all-rtl-debug_02.css 55KB
ext-theme-neptune-all-rtl-debug_02.css 55KB
ext-theme-crisp-all-rtl-debug_02.css 41KB
ext-theme-crisp-touch-all-rtl-debug_02.css 41KB
ext-theme-neptune-all-rtl_02.css 34KB
ext-theme-neptune-touch-all-rtl_02.css 33KB
ext-theme-crisp-all-rtl_02.css 26KB
ext-theme-crisp-touch-all-rtl_02.css 25KB
ext-theme-neptune-all-debug_02.css 10KB
ext-theme-neptune-touch-all-debug_02.css 10KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
reporter.css 7KB
jasmine.css 6KB
ext-theme-neptune-all_02.css 6KB
ext-theme-neptune-touch-all_02.css 5KB
GroupTabPanel.css 4KB
statusbar.css 3KB
ItemSelector.css 629B
TabScrollerMenu.css 408B
example.css 347B
example.css 345B
example.css 343B
example.css 339B
example.css 339B
example.css 337B
example.css 336B
Explorer.css 324B
bootstrap.css 291B
bootstrap.css 284B
ext-theme-neptune-touch-all-rtl-debug.css 112B
ext-theme-neptune-touch-all-rtl.css 110B
共 7558 条
- 1
- 2
- 3
- 4
- 5
- 6
- 76
资源评论
ajuan1217
- 粉丝: 0
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功