Change Mouse sensitivity in Chart in Flex4


 

Change Mouse sensitivity in Chart in Flex4

You can change the mouse sensitivity by using mouseSensitivity property. The value of mouseSensitivity property is numeric.

You can change the mouse sensitivity by using mouseSensitivity property. The value of mouseSensitivity property is numeric.

Change Mouse Sensitivity in Chart in Flex4:

You can change the mouse sensitivity by using mouseSensitivity property. The value of mouseSensitivity property is numeric. The default value of this property is 3. In this example we use a slider for changing the value of mouse sensitivity.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<fx:Declarations>

<s:SolidColor id="s1" color="#990000" alpha=".3"/>

<s:SolidColor id="s2" color="#808080" alpha=".3"/>

<s:SolidColor id="s3" color="#cc00cc" alpha=".3"/>

<s:SolidColorStroke id="scs1" color="#990000" weight="2"/>

<s:SolidColorStroke id="scs2" color="#808080" weight="2"/>

<s:SolidColorStroke id="scs3" color="#cc00cc" weight="2"/>

</fx:Declarations>

<fx:Script>

<![CDATA[

import mx.collections.ArrayCollection;

[Bindable]

public var student:ArrayCollection = new ArrayCollection([

{Stream: "Management", Girls:1000, Boys:1400, TotalStudent:2400},

{Stream: "Computer Science", Girls:800, Boys:1200, TotalStudent:2000},

{Stream: "Mechanical", Girls:200, Boys:1500, TotalStudent:1700},

{Stream: "Electical", Girls:800, Boys:850, TotalStudent:1650},

{Stream: "Electronics", Girls:500, Boys:1000, TotalStudent:1500},

{Stream: "Civil", Girls:300, Boys:900, TotalStudent:1200}

]);

]]>

</fx:Script>

<s:Panel title="Change mouse sensitivity in Chart Example" width="639" height="579">

<s:layout>

<s:VerticalLayout/>

</s:layout>

<mx:PlotChart id="pchart"

dataProvider="{student}"

showDataTips="true"

fontFamily="verdana"

width="537" height="445" mouseSensitivity="{slider.value}">

<mx:series>

<mx:PlotSeries id="ps1"

xField="Boys"

yField="Girls"

displayName="Boys/Girls"

fill="{s1}"

stroke="{scs1}"

itemRenderer="mx.charts.renderers.CrossItemRenderer"

radius="10"/>

<mx:PlotSeries id="ps2"

xField="TotalStudent"

yField="Boys"

displayName="TotalStudent/Boys"

fill="{s2}"

stroke="{scs2}"

itemRenderer="mx.charts.renderers.DiamondItemRenderer"

radius="10"/>

<mx:PlotSeries id="ps3"

xField="TotalStudent"

yField="Girls"

displayName="TotalStudent/Girls"

fill="{s3}"

stroke="{scs3}"

itemRenderer="mx.charts.renderers.TriangleItemRenderer"

radius="10"/>

</mx:series>

</mx:PlotChart>

<s:HGroup>

<mx:Legend dataProvider="{pchart}"/>

<s:VGroup>

<s:Label text="Mouse Sensitivity:"/>

<mx:HSlider id="slider"

minimum="0"

maximum="500"

value="20"

dataTipPlacement="top"

tickColor="blue"

snapInterval="2"

tickInterval="50"

labels="['0','500']"

allowTrackClick="true"

liveDragging="true"/>

</s:VGroup>

</s:HGroup>

</s:Panel>

</s:Application>

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Ads