tag:blogger.com,1999:blog-70671117019704880192024-03-14T01:27:59.422-07:00My Take On TechI have created this blog to discuss various technologies. However, i will be talking mostly about Flex, Flash builder and related stuffSudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-7067111701970488019.post-43597304699543948652010-04-04T07:45:00.000-07:002010-04-04T09:57:55.054-07:00First look on Mirroring and ChartsCouple of quick updates before i elaborate on mirroring.<div><ol><li>Flex 4 and Flash builder 4 are up for grabs. You can download them from <a href="http://www.adobe.com/products/flex/">here</a></li><li>Advanced Data visualization components (which include ADG, ODG and Charts) are now a part of free open source flex sdk.</li></ol></div><div>There's gonna be a follow up version for flex sdk 4.0, which will include <a href="http://opensource.adobe.com/wiki/display/flexsdk/Layout+Mirroring">layout mirroring</a> feature. This feature is intended to trivialize repurposing a GUI designed for a LTR language, like English, for a RTL language like Hebrew or Farsi. Following Q&As might help you to understand\ picturize the feature better. I have focussed on its impact on charts.</div><div><br /></div><div><b>Q</b>: How can I set the layout for a RTL language?</div><div><b>A</b>: <i>The mirroring API is defined by a new interface called ILayoutDirectionElement. The interface defines the layoutDirection property whose value can be "ltr" or "rtl". By setting the property value to "rtl", at the application (root) level , the layout will be mirrored. </i></div><div><i><br /></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><b>Q</b>: Can i set layoutDirection at component\container level, instead of setting it at application(root) level?</span></i></div><div><i><b>A</b>: Yes. For example, you can set layoutDirection for ColumnChart by using this code </i></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcAGEvfiHVJTeLnLJvxP3gHjGo8fVxTmjXx2PRuSNyhEg58C9wrbGteSJQ0jLzYWEBcaboTpjCA-k2IFzyUGrod7-2kOr05izQQWxGyuZck_FNkUTTIFH2txRryPxJDS0p9ABWffoKssI/s1600/ds.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcAGEvfiHVJTeLnLJvxP3gHjGo8fVxTmjXx2PRuSNyhEg58C9wrbGteSJQ0jLzYWEBcaboTpjCA-k2IFzyUGrod7-2kOr05izQQWxGyuZck_FNkUTTIFH2txRryPxJDS0p9ABWffoKssI/s320/ds.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5456315418075038306" style="cursor: pointer; width: 320px; height: 14px; " /></a><div><i><span class="Apple-style-span" style="font-style: normal; "><b><br /></b></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><b>Q</b>: How would a chart look in a RTL layout?</span></i></div><div><i><b>A</b>: Sample image of a line chart with DateTimeAxis whose layoutDirection is set to RTL is shown below</i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR3y9WcJ-QOTAo_hy178XKuNH3yXA766zvZM9EmSqMJzpH2ksJjG4ubI7sRSB-1qK2tOI_-wP2l_vcZWGDYsJQ15iardJiwFsh4nIVlYZIJQ_NWBuDbA2I9wmi6RyyjUi53KC0vw9u_Qs/s1600/lineChart_RTL.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR3y9WcJ-QOTAo_hy178XKuNH3yXA766zvZM9EmSqMJzpH2ksJjG4ubI7sRSB-1qK2tOI_-wP2l_vcZWGDYsJQ15iardJiwFsh4nIVlYZIJQ_NWBuDbA2I9wmi6RyyjUi53KC0vw9u_Qs/s320/lineChart_RTL.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5456318063472397826" style="cursor: pointer; width: 320px; height: 191px; " /></a></span></i></div><div><i><br /></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><b>Q</b>: layoutDirection for the Application is ltr , and layoutDirection for chart is set as rtl. Is this a valid scenario? How would the application look at the runtime?</span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><b>A</b>: Yes. It is a valid scenario. Only the chart will be mirrored and not the application. Hence, the chart will be on the left hand side at the run time. An HLOC chart for the above scenario is shown below</i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMiEOcmvOGDegPRaIKYTE2cU8-DaHCCTftoA65wFbO7Af7G4_Y6wBEDeFWhytDWaO__AwekWkDr9xaZ1NxZH18QZ0moIEE0fa6vqbOshtZr5yGAyIpzJBhgvcCBUX_bRM2gMYeLElHwg/s1600/HLOC_Mirrored.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMiEOcmvOGDegPRaIKYTE2cU8-DaHCCTftoA65wFbO7Af7G4_Y6wBEDeFWhytDWaO__AwekWkDr9xaZ1NxZH18QZ0moIEE0fa6vqbOshtZr5yGAyIpzJBhgvcCBUX_bRM2gMYeLElHwg/s320/HLOC_Mirrored.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5456321440060244546" style="cursor: pointer; width: 320px; height: 197px; " /></a></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMiEOcmvOGDegPRaIKYTE2cU8-DaHCCTftoA65wFbO7Af7G4_Y6wBEDeFWhytDWaO__AwekWkDr9xaZ1NxZH18QZ0moIEE0fa6vqbOshtZr5yGAyIpzJBhgvcCBUX_bRM2gMYeLElHwg/s1600/HLOC_Mirrored.JPG"></a><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><b>Q</b>: When layoutDirection is set to rtl, what will be the text allignment of the text in the datatip for a chart?</span></i></span></i></span></i></span></i></span></i></div><div><i><span class="Apple-style-span"><i><span class="Apple-style-span"><i><b>A:</b><span class="Apple-style-span"> Text alignment in the datatip depends on the style "direction". If we want the text inside the datatip to be right aligned, we should set the direction to "rtl" as given below. This is independent of layoutDirection. </span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmu9Y_lABGMZFImv3Wh9W-tR0whIYjPsqHWvf9vqnXl5JHE5ZNNtlxvKlsORFWjjAN_ufDFcmmWlt7jn6hEYN3BYjL0rkazLhOE-ot9prW_J4O29vP5cPHjlFiKJQlC_LRyHgz3VZiSYk/s1600/direction_DataTip.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmu9Y_lABGMZFImv3Wh9W-tR0whIYjPsqHWvf9vqnXl5JHE5ZNNtlxvKlsORFWjjAN_ufDFcmmWlt7jn6hEYN3BYjL0rkazLhOE-ot9prW_J4O29vP5cPHjlFiKJQlC_LRyHgz3VZiSYk/s320/direction_DataTip.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5456324271875572514" style="cursor: pointer; width: 320px; height: 89px; " /></a></span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "> </span></i></span></i></span></i></span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; ">Comments\feedback are welcome.</span></i></span></i></span></i></span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><br /></span></i></span></i></span></i></span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; ">Thanks,</span></i></span></i></span></i></span></i></span></i></span></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; "><i><span class="Apple-style-span" style="font-style: normal; ">Sudhir</span></i></span></i></span></i></span></i></span></i></span></i></div>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com1tag:blogger.com,1999:blog-7067111701970488019.post-86523045251262952242010-01-11T04:07:00.000-08:002010-01-11T04:34:47.183-08:00How to set timezone manually for php<span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;">Recently, i was trying to fetch some data which had date in it, using XAMPP 1.7.2 and <span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><span class="Apple-style-span" style="font-family:arial;"><a href="http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUIHB"><span class="Apple-style-span" style="color:#000000;">FlashBuilder 4</span></a> , and I faced the error given below.</span></span><br /></span></span><div><div><div><br /></div><div><span style="font-size:85%;"><span class="Apple-style-span" style="color:#FF0000;"><span class="Apple-style-span" style="font-family:georgia;">InvocationTargetException:There was an error while invoking the operation. Check your server settings and try invoking the operation again.<br />Reason: Server error DateTime::__construct() [</span></span><a href="http://www.blogger.com/datetime.--construct"><span class="Apple-style-span" style="color:#FF0000;"><span class="Apple-style-span" style="font-family:georgia;">datetime.--construct</span></span></a><span class="Apple-style-span" style="color:#FF0000;"><span class="Apple-style-span" style="font-family:georgia;">]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for '5.5/no DST' instead #0</span></span></span></div><div><span class="Apple-style-span" style="font-family:arial;color:#FF0000;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:arial;color:#FF0000;"><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="color:#000000;">To overcome this, we have to manually set the timezone. Explanation is given below. </span></div><div><span class="Apple-style-span" style="color:#000000;">Since PHP 5.1, there has been an extension named 'date' in the PHP core. This is the new implementation of PHP's datetime support. Although it will attempt to guess your system's timezone setting, you should set the timezone manually. You can do this in three ways : </span></div><div><span class="Apple-style-span" style="color:#000000;">1) in your php.ini using the date.timezone INI directive </span></div><div><span class="Apple-style-span" style="color:#000000;">2) on your system using the TZ environmental variable </span></div><div><span class="Apple-style-span" style="color:#000000;">3) from your script using the convenience function date_default_timezone_set()</span></div><div><span class="Apple-style-span" style="color:#000000;"><br /></span></div><div><span class="Apple-style-span" style="color:#000000;">I chose the step 3 to make things work. Since i reside in India, i added the below line in my php service.</span></div><div><ul><li><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">date_default_timezone_set('Asia/Calcutta');</span></li></ul></div><div><span class="Apple-style-span" style="color:#000000;">For other countries, timezones can be found <a href="http://www.php.net/manual/en/timezones.php">here</a></span></div><div><span class="Apple-style-span" style="color:#000000;">Below links can be useful for further understanding, which i have used as references.</span></div><div><span class="Apple-style-span" style="color:#000000;"><a href="http://php.interec.es/UPDATE_5_2.txt">http://php.interec.es/UPDATE_5_2.txt</a> </span></div><div><span class="Apple-style-span" style="color:#000000;"><a href="http://php.net/manual/en/function.date-default-timezone-set.php">http://php.net/manual/en/function.date-default-timezone-set.php</a></span></div></span></span></div></div></div>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com0tag:blogger.com,1999:blog-7067111701970488019.post-13002867114336384912009-10-06T10:21:00.000-07:002009-10-06T10:35:58.492-07:00How to set basic authentication for php in flex 4<p class="MsoPlainText">I have listed down the steps which will help you to use basic authentication for php services using Zend in FlashBuilder4<br /></p><p class="MsoPlainText">1. Have a function called <span style="font-style: italic;">initAcl($acl)</span> in the php service similar to the one given below. All the functions inside the service which need authentication should be mentioned in this function( i.e., <span style="font-style: italic;">initAcl</span>)<br /></p><span style="color: rgb(51, 51, 255);"><span class="Apple-style-span" style="color: rgb(51, 51, 255);"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family:arial;"><blockquote><span class="Apple-style-span" style="font-size:small;">function initAcl(Zend_Acl $acl) {<br />$acl->allow('role1', null, 'function1');<br />$acl->allow('role2', null, array('function1', 'function2'));<br />return true;<br />}</span></blockquote></span></span></span></span><p class="MsoPlainText">Please find a sample service <a href="http://sites.google.com/site/msudhir86/php-authenticaiton/TestAuthentication.php">here</a></p><p class="MsoPlainText">2. Have a security.xml file which specifies the user roles and has user name and passwords stored in it. Sample contents of the xml file is given below.</p><span class="Apple-style-span" style="color: rgb(51, 51, 255);"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family:arial;"><blockquote><span class="Apple-style-span" style="font-size:small;"><roles><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><role id='admin'><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><user name='user1' password='pwd'/><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></role><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><role id='hr'><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><user name='user2' password='pwd2'/><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></role><br /></roles></span></blockquote></span></span></span><p class="MsoPlainText"><span class="Apple-style-span" style="color: rgb(51, 0, 51);">3. Security.xml file can be placed anywhere (placing it outside the webroot is recommended. ) The path has to be specified in the gateway.php file . Also a small code has to be added in the<span style="text-decoration: underline;"> </span>gateway.php file as given below. </span><span class="Apple-style-span" style="color: rgb(51, 102, 255);"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><span style="color: rgb(255, 0, 0);"></span></span></span></span><span class="Apple-style-span" style="color: rgb(51, 0, 51);"><br /></span></p><span class="Apple-style-span" style="color: rgb(51, 102, 255);"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family:arial;"></span></span></span><blockquote><span class="Apple-style-span" style="color: rgb(51, 102, 255);"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;">$auth = new Zend_Amf_Adobe_Auth("<span style="color: rgb(255, 0, 0);">C:\wamp\security</span></span></span></span><span style="color: rgb(255, 0, 0);font-family:arial;" class="Apple-style-span" ><span class="Apple-style-span" style="color: rgb(255, 0, 0);"><span class="Apple-style-span" style="font-size:small;">.xml</span></span></span><span class="Apple-style-span" style="color: rgb(51, 102, 255);"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;">");<br />$server->setAuth($auth);<br />$server->setAcl($auth->getAcl());</span></span></span></blockquote><p class="MsoPlainText"><span class="Apple-style-span" style="color: rgb(51, 0, 51);">Refer to <a href="http://sites.google.com/site/msudhir86/php-authenticaiton/gateway.php">this</a> gateway.php file to know where exactly should the above code be added<br /></span></p><p class="MsoPlainText"><span class="Apple-style-span" style="color: rgb(51, 0, 51);">4. below code has to be added in the mxml, where serviceName1 is the name of the service created.<br /></span></p><p class="MsoPlainText"><span id="content_PHP" class="cloak" style="color: rgb(51, 102, 255);"><em></em></span></p><blockquote><span id="content_PHP" class="cloak" style="color: rgb(51, 102, 255);"><em>serviceName1.serviceControl.setCredentials(<br />'username','password',null);</em></span></blockquote>Support for basic authentication in php is added in Beta 2 release of <a href="http://labs.adobe.com/technologies/flashbuilder4/">FlashBuilder 4</a>.<br /><p></p><span class="Apple-style-span" style="color: rgb(51, 0, 51);"></span><p></p>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com1tag:blogger.com,1999:blog-7067111701970488019.post-21824336932116774062009-09-10T05:53:00.000-07:002009-09-10T08:19:16.204-07:00Whats new in charts in Flex 4<blockquote></blockquote>I have already discussed about few of the enchancements done in Charts for Flex4, in my earlier posts. Direct links to those posts can be found below.<div><br /><div><b><span class="Apple-style-span" style="font-size:large;">1</span>.</b> <a href="http://sudhirmanjunath.blogspot.com/2009/06/inverted-axis-supported-in-flex-4.html">http://sudhirmanjunath.blogspot.com/2009/06/inverted-axis-supported-in-flex-4.html</a></div><div><b><span class="Apple-style-span" style="font-size:large;">2</span>.</b> <a href="http://sudhirmanjunath.blogspot.com/2009/06/new-style-called-renderdirection-added.html">http://sudhirmanjunath.blogspot.com/2009/06/new-style-called-renderdirection-added.html</a></div><div><br /></div><div>Apart from the above two enhancements, support is also provided for custom filter functions on the chart series. 2 new properties filterDataValues and filterFunction have been added to series.</div><div><br /></div><div><b>3. filterDataValues</b><b>: <span class="Apple-style-span" style=" font-weight: normal; font-family:Tahoma;"><span class="Apple-style-span" style="font-size:medium;">If </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterFuction</span></code><span class="Apple-style-span" style="font-size:medium;"> is set, </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterDataValues</span></code><span class="Apple-style-span" style="font-size:medium;"> and </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterData</span></code><span class="Apple-style-span" style="font-size:medium;"> are ignored. If </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterDataValues</span></code><span class="Apple-style-span" style="font-size:medium;"> property is set to </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">none</span></code><span class="Apple-style-span" style="font-size:medium;">, series will not filter its data before displaying. If </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterDataValues</span></code><span class="Apple-style-span" style="font-size:medium;"> is set to </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">nulls</span></code><span class="Apple-style-span" style="font-size:medium;">, series filters data like </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">null</span></code><span class="Apple-style-span" style="font-size:medium;">, </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">undefined</span></code><span class="Apple-style-span" style="font-size:medium;">, or </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">NaN</span></code><span class="Apple-style-span" style="font-size:medium;"> before displaying. If this property is set to </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">outsideRange</span></code><span class="Apple-style-span" style="font-size:medium;">, series filters its data like </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">null</span></code><span class="Apple-style-span" style="font-size:medium;">, </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">undefined</span></code><span class="Apple-style-span" style="font-size:medium;">, or </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">NaN</span></code><span class="Apple-style-span" style="font-size:medium;"> and also the values that are outside the range of the chart axes. If you know that all of the data in the series is valid, you can set this to </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">none</span></code><span class="Apple-style-span" style="font-size:medium;"> to improve performance.</span></span></b></div><div><span class="Apple-style-span" style="font-family:Tahoma;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma;"><b><span class="Apple-style-span" style="font-size:medium;">4. filterFunction</span></b><span class="Apple-style-span" style="font-size:medium;">: Specifies a method that returns the array of chart items in the series, that are to be displayed. If this property is set, the return value of the custom filter function takes precedence over the </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterDataValues</span></code><span class="Apple-style-span" style="font-size:medium;"> and</span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterData</span></code><span class="Apple-style-span" style="font-size:medium;"> properties. But if it returns null, then </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterDataValues</span></code><span class="Apple-style-span" style="font-size:medium;"> and </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterData</span></code><span class="Apple-style-span" style="font-size:medium;"> will be prefered in that order.</span></span></div><span class="Apple-style-span" style="font-family:Tahoma;"><p><span class="Apple-style-span" style="font-size:medium;">The custom </span><code style="font-family:'Lucida Console', 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size:medium;">filterFunction</span></code><span class="Apple-style-span" style="font-size:medium;"> has the following signature:</span></p><pre style="font-family:'Lucida Console', 'Courier New', Courier, monospace;font-size:12px;"><span class="Apple-style-span" style="font-size:medium;"> </span><i><span class="Apple-style-span" style="font-size:medium;">function_name</span></i><span class="Apple-style-span" style="font-size:medium;"> (cache:Array):Array { ... }</span></pre></span><div><span class="Apple-style-span" style="font-size:medium;"><b></b></span></div><div><span class="Apple-style-span" style="font-size:medium;">Below is an example of custom filter function:</span></div><br /><i><span class="Apple-style-span" style="color:#666666;">public function myFilterFunction(cache:Array):Array {<br />var filteredCache:Array=[];<br />var n:int = cache.length;<br /> for(var i:int = 0; i < n; i++){<br /> var item:ColumnSeriesItem = ColumnSeriesItem(cache[i]);<br /> if(item.yNumber > 0 && item.yNumber < 700)<br /> {<br /> filteredCache.push(item);<br /> }<br /> }<br /> return filteredCache;<br />}</span></i></div><div><br /></div><div> <span style="font-weight:bold;"><span class="Apple-style-span" style="font-size: medium;">5.</span></span><span class="Apple-style-span" style="font-size: medium;"> If you are working with Data Centric applications, binding data to charts has been made very simple in Flash Builder 4. I am going to talk about this in my future posts. Watch out this space for more on </span><a href="http://srinivasannam.wordpress.com/2009/06/01/introduction_to_dcd/"><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="color:#3333FF;">DataCentricDevelopment</span></span></a><span class="Apple-style-span" style="font-size: medium;"> support for Charts.<br /></span><span style="font-weight:bold;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span style="font-weight:bold;"><span class="Apple-style-span" style="font-size: medium;">6.</span></span><span class="Apple-style-span" style="font-size: medium;"> Apart from the enhancements mentioned above, there have been a lot of bug fixes. Please use this </span><a href="http://bugs.adobe.com/flex"><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="color:#3366FF;">link</span></span></a><span class="Apple-style-span" style="font-size: medium;"> to log\ serach for bugs.</span></div><span class="Apple-style-span" style="font-size: medium;"><br /><br />Thanks,<br />Sudhir</span>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com0tag:blogger.com,1999:blog-7067111701970488019.post-23924480333792048802009-09-08T12:44:00.000-07:002009-09-08T13:05:59.976-07:00Reading from the web "Readefined"U are reading a really long blog and are lazy to scroll till you reach the end of the page. Imagine how cool it would be if you can read the same blog in a multi-column layout, just as if you were reading a paper!<div> </div><div><a href="http://readefine.anirudhsasikumar.net/">Here</a> is a cool app which helps you do just the same which is developed by one of our collegues, <a href="http://anirudhs.chaosnet.org/">Anirudh</a>. It uses TLF(Text layout format) included in Flex 4. Now this is what i call awesomeness reAdefined. </div>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com0tag:blogger.com,1999:blog-7067111701970488019.post-28449295998865540892009-06-21T14:58:00.001-07:002009-06-21T16:10:13.728-07:00Inverted axis supported in Flex 4 chartsWe can now create charts with inverted axis. A column Chart with inverted axis will look like this.<div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp_cnNkmzT6jTGAlUgQsoBXTCSMZnwksCXqHXJ7UinmvLOBDEw0uaSMief7hZ0W1afsxoXEQcpTq0-tRmBnjK9Gt0ccJPo0niHjgCJTO7TbDIz7V-xXeGw8qSIrB3_XhjNJW4fysSwoIk/s1600-h/InvertedAxis_Charts.JPG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 158px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp_cnNkmzT6jTGAlUgQsoBXTCSMZnwksCXqHXJ7UinmvLOBDEw0uaSMief7hZ0W1afsxoXEQcpTq0-tRmBnjK9Gt0ccJPo0niHjgCJTO7TbDIz7V-xXeGw8qSIrB3_XhjNJW4fysSwoIk/s320/InvertedAxis_Charts.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5349921793950586722" /></a><br /><div style="text-align: left;">This is made possible by adding a new property "<b>direction</b>" on NumericAxis from which the LinearAxis, LogAxis and DateTimeAxis are derived. Accepted values for "direction" are <span style="font-style:italic;"><b>normal</b></span> and <span style="font-style:italic;"><b>inverted. </b><span class="Apple-style-span" style="font-style: normal;">If the value is </span>inverted<span class="Apple-style-span" style="font-style: normal;"> for its "direction" property, axis will be inverted. </span></span>The default value for direction is <i>normal.</i></div><div>Here is a <a href="http://sites.google.com/site/msudhir86/Home/attachements/invetedAxis_Charts.swf">sample</a> and <a href="http://sites.google.com/site/msudhir86/Home/attachements/invetedAxis_Charts.mxml">source</a> for the same.</div><div><mx:verticalaxis><mx:linearaxis id="vaxis" baseatzero="false" title="Price" direction="inverted"></mx:linearaxis></mx:verticalaxis><div><br /></div><div><div></div></div></div></div>Sudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com1tag:blogger.com,1999:blog-7067111701970488019.post-20432012557247167092009-06-21T13:42:00.000-07:002009-06-21T14:26:43.550-07:00New style renderDirection for PieSeries added in Flex 4A new style <span style="font-style:italic;">renderDirection<span style="font-weight:bold;"></span></span> is added to PieSeries depending on which the wedges in the series are drawn. It accepts 2 values "clockwise" and "counterClockwise".<br />Default is <span style="font-style:italic;">counterClockwise</span> which shows current behavior, renders the wedges in anti-clockwise direction. <span style="font-style:italic;">clockwise</span> renders them in clockwise direction. <br /><br />Click <a href="http://sites.google.com/site/msudhir86/Home/attachements/PieChart_Selection.swf">here</a> to check out a working example<br />Click <a href="http://sites.google.com/site/msudhir86/Home/attachements/PieChart_Selection.mxml">here</a> for the sourceSudhirhttp://www.blogger.com/profile/05763969987613657650noreply@blogger.com0