/**
* @name AnyChart
* @projectDescription AnyChart JavaScript Integration Library
*
* @version 2.7
*
*/
var com = {};
com.anychart = {};
/**
* BrowserTypeInformation class
* @static
* @class BrowserTypeInformation
* Brower information
*/
var BrowserTypeInformation = function(){};
/**
* Is browser Internet Explorer?
* @static
* @field {Boolean}
*/
BrowserTypeInformation.isIE = /(msie|internet explorer)/i.test(navigator.userAgent);
/**
* Is browser Apple Sarari?
* @static
* @field {Boolean}
*/
BrowserTypeInformation.isSafari = /safari/i.test(navigator.userAgent);
/**
* Is browser Opera?
* @static
* @field {Boolean}
*/
BrowserTypeInformation.isOpera = (window.opera != undefined);
//---------------------------------------------------------------------
//
// AnyChart class
//
//---------------------------------------------------------------------
/**
* AnyChart class
*
* @class AnyChart
* @alias com.anychart.AnyChart
* @param {String} [swfPath] path to chart swf file
* @param {String} [preloaderSWFPath] path to chart preloader swf file
*/
com.anychart.AnyChart = function(){
switch (arguments.length) {
case 0:
this.constructor();
break;
case 1:
this.constructor(arguments[0]);
break;
case 2:
this.constructor(arguments[0],arguments[1]);
break;
}
};
var AnyChart = com.anychart.AnyChart;
AnyChart._charts = {};
AnyChart.prototype = {
//------------------------------------
// html wrapper
//------------------------------------
/**
* chart id
* @field {String}
*/
id: null,
/**
* chart width
* @see AnyChart.width
* @field {String}
*/
width: NaN,
/**
* chart height
* @see AnyChart.height
* @field {String}
*/
height: NaN,
quality: "high",
/**
* Flash movie background html color
* @field {String}
*/
bgColor: "#FFFFFF",
/**
* Path to swf file
* @field {String}
*/
swfFile: null,
/**
* Path to preloader swf file
* @field {String}
*/
preloaderSWFFile: null,
/**
* embed (or object) DOM element with chart
* @field {Object}
*/
flashObject: null,
_containerNode: null,
_containerId: null,
_isWrited: false,
/**
* Text to be shown on preloader initilization
* @field {String}
*/
preloaderInitText: null,
/**
* Text to be shown while AnyChart is loading AnyChart.Swf
* @field {String}
*/
preloaderLoadingText: null,
/**
* Text to be shownwhile AnyChart is initializing
* @field {String}
*/
initText: null,
/**
* Text to be shown while AnyChart is loading XML Data.
* @field {String}
*/
xmlLoadingText: null,
/**
* Text to be shown while AnyChart is loading resources (images, etc.)
* @field {String}
*/
resourcesLoadingText: null,
/**
* Text to be shown when AnyChart gets chart without data.
* @field {String}
*/
noDataText: null,
/**
* Text to be shown when AnyChart gets no data source (neither XMLFile nor XMLText is set to chart)
* @field {String}
*/
waitingForDataText: null,
/**
* Text to be shown while AnyChart is loading chart templates
* @field {String}
*/
templatesLoadingText: null,
/**
* Sets the Window Mode property of the SWF file for transparency, layering, and
* positioning in the browser. Valid values of wmode are window, opaque, and transparent.
* Set to <code>window</code> to play the SWF in its own rectangular window on a web page.
* Set to <code>opaque</code> to hide everything on the page behind it.
* Set to <code>transparent</code> so that the background of the HTML page shows through all transparent portions of the SWF file.
* @field {String}
*/
wMode: null,
dispatchMouseEvents: true,
_canDispatchEvent: false,
_nonDispatcedEvents: null,
_protocol: "http",
constructor: function() {
//check protocol
if (location.protocol == 'https:')
this._protocol = 'https';
else
this._protocol = 'http';
this.id = AnyChart.getUniqueChartId();
switch (arguments.length) {
case 0:
this.swfFile = AnyChart.swfFile;
this.preloaderSWFFile = AnyChart.preloaderSWFFile;
break;
case 1:
this.swfFile = arguments[0];
this.preloaderSWFFile = AnyChart.preloaderSWFFile;
break;
case 2:
this.swfFile = arguments[0];
this.preloaderSWFFile = arguments[1];
break;
}
this.width = AnyChart.width;
this.height = AnyChart.height;
this.quality = 'high';
this.bgColor = '#FFFFFF';
this._xmlFile = null;
this.loaded = false;
this._listeners = new Array();
this._loaded = false;
this._created = false;
this._canDispatchEvent = false;
this._nonDispatcedEvents = new Array();
this.wMode = null;
this.dispatchMouseEvents = true;
var ths = this;
this.addEventListener('create', function(e) {
ths._onChartLoad();
});
this.addEventListener('draw', function(e) {
ths._onChartDraw();
});
this._xmlSource = null;
this._isWrited = false;
this._containerId = null;
this._containerNode = null;
this.preloaderInitText = AnyChart.preloaderInitText;
this.preloaderLoadingText = AnyChart.preloaderLoadingText;
this.initText = AnyChart.initText;
this.xmlLoadingText = AnyChart.xmlLoadingText;
this.resourcesLoadingText = AnyChart.resourcesLoadingText;
this.noDataText = AnyChart.noDataText;
this.waitingForDataText = AnyChart.waitingForDataText;
this.templatesLoadingText = AnyChart.templatesLoadingText;
this._enableMouseEvents = false;
AnyChart._registerChart(this);
},
/**
* Write anychart html code into page<br />
* if target not specified - Directly write to the current window
* else if target is String - Write to element in the current window by its id
* else write to element in the current window by its reference
* @method
* @param {Object} [target]
*/
write: function() {
if (!this._checkPlayerVersion()) return;
if (this._isWrited) return;
var htmlCode = this._getFlashObjectHTML();
if (arguments[0] == undefined) {
this._writeToCurrentWindow(htmlCode);
} else {
var target = arguments[0];
if (!BrowserTypeInformation.isIE && (!BrowserTypeInformation.isSafari && !BrowserTypeInformation.isOpera && target instanceof Window)) {
this._writeToWindow(target, htmlCode);
} else if (typeof (target) == 'string' || (!BrowserTypeInformation.isSafari && target instanceof String)) {
this._writeToHTMLTarget(target, htmlCode);
} else if (BrowserTypeInformation.isIE && target.innerHTML == undefined) {
this._writeToWindow(target, htmlCode);
} else {
this._writeToHTMLTarget(target, htmlCode);
}
}
this._canDispatchEvent = true;
for (var i = 0; i < this._nonDispatcedEvents.length; i++) {
this.dispatchEvent(this._nonDispatcedEvents[i]);
}
this._isWrited = true;
},
_writeToCurrentWindow: function(htmlCode) {
this._writeToWindow(window, htmlCode);
},
_writeToWindow: functio

xiaojinchao
- 粉丝: 2
最新资源
- 基于项目管理的发展趋势而持续改进的研究.doc
- 基于单片机的智能风扇控制系统设计.doc
- 星痕共鸣DPS统计工具部署教程
- 机械CADCAM技术第章4.pptx
- 项目管理规范及流程.doc
- 微信授权及用户信息获取示例演示
- 网络类产品安装调试方案.doc
- 工程项目管理期末试卷A-答案.doc
- 基于企业信息系统的网络安全研究.pdf
- 建设工程项目管理模拟试题一.doc
- 论人工智能技术在军事领域的运用.doc
- 基于PLC的三层电梯设计.doc
- 云计算安全服务IPO上市咨询最新政策募投可研细分市场调查综合解决方案.docx
- 中小学“互联网+”思维和应用能力提升培训学习体会.docx
- 分销网络结构设计.pdf
- 技校化工仪表及自动化教学模式探索获奖科研报告论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



- 1
- 2
前往页