⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mousehandling.mxml

📁 chart应用蛮广泛的
💻 MXML
字号:
<?xml version="1.0" encoding="utf-8"?>
<ex:ExampleBase  xmlns:ex="examples.*" xmlns="http://www.adobe.com/2006/mxml">

	<Script>
		<![CDATA[

			override public function get descriptions():Array {
				return ["a simple two series column chart"];
			}
		private function updateDetails(e:MouseEvent):void
		{
			/* first show the coordiantes represented where the event happened, relative to the target of the event */
			epos.text = "(" + e.localX + "," + e.localY + ")";

			/* now show the coordiantes of the mouse relative to the chart */
			var p:Point = new Point(chart.mouseX,chart.mouseY);
			mpos.text = "(" + p.x + "," + p.y + ")";
			/* now ask the chart what data values that represents */
			var d:Array = chart.localToData(p);
			dpos.text = "(" + Math.floor(d[0]) + "," + Math.floor(d[1]) + ")";
			/* now ask the chart to convert those data values back into screen coordinates */
			p = chart.dataToLocal(d[0],d[1]);
			spos.text ="(" + Math.floor(p.x) + "," + Math.floor(p.y) + ")";
		}

		[Bindable] public var overItem:Boolean = false;
		]]>
	</Script>

	<ex:controls>
		<Label text="mousePos:" />
		<Label id="mpos" />
		<Label text="dataSet:" />
		<Label id="dpos" />
		<Label text="screenPos:" />
		<Label id="spos" />
		<Label text="eventPos:" />
		<Label id="epos" />
		<Label text="MOUSE OVER DATAPOINT" visible="{overItem}"/>
	</ex:controls>

	<Model id="dataSet" source="/data/sampleData.xml" />

	<PlotChart id="chart" width="100%" dataProvider="{dataSet.Sample}"  height="100%" mouseMove="updateDetails(event)"
		itemRollOver="overItem=true" itemRollOut="overItem=false" >
		<series>
			<PlotSeries xField="revenue" yField="costs" itemRenderer="mx.charts.renderers.CircleItemRenderer" radius="3"/>
		</series>

	</PlotChart>

</ex:ExampleBase>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -