Inverting an Axis on a chart

I had a case on my latest project where I had a chart that needed to not start at 0,0 as most do. Rather this chart, and the data it represented needed to have it's Y Axis inverted. The better numbers were closer to the bottom, and higher in value. 0 was bad.

I did some searching and there seemed to be one common approach. manually invert your data. I wasn't sure that was what I wanted, but it turned out that that approach worked really well.

 

in the function that creates the data for the chart, I simply invert the values by subtracting 2* the value, from itself

val.perfRank = (performance - (performance * 2));
val.availRank = (availability - (availability * 2));
val.consistRank = (consistency - (consistency * 2));

 

After populating my dataprovider with the inverted values, all I needed was a label function to undo my voodoo.

private function rankLabelFunction(labelValue:Object, previousLabelValue:Object, axis:IAxis):Number
        {
            var newAxisValue:Number = Number(labelValue);
            newAxisValue = (newAxisValue + (Math.abs(newAxisValue) * 2));   
            return newAxisValue;
        }

You'll want to make sure to do the absolute value, LOL. Otherwise you'll be like me, "Why is the negative number, even bigger? Oh yeah! Duh!" Math, not my strong suit.

There may be more elegant  ways, I sorta hope there are or will be, but this is a pretty straight forward way to simply put your lowest value at the top of your axis, which is what I needed.

Great Degrafa preso at the RMAUG last night!

I was able to make it over to The Hive last night to see Juan "the hard core super star Degrafa Guy" Sanchez present Degrafa at the RMAUG. I just made up that name, but it fits, so he's welcome to it if he likes.

Dave and company have a new home at The Hive, which is a very sweet co-working facility here in Denver.

 

Juan's session was well timed, i had spent a good chunk of the day figuring out how to skin a link button. Turned out livedocs was spot on with it's example (go figure). But after watching Juan skin a button, I was wishing we had Degrafa in the project I'm on. I did think about using it, but figured that was a decision to be discussed before I committed a whole new library of code.

So my solution, worked well enough, but the Degrafa way is killer.

In a Skin file...

<code>

<fills>
        <SolidFill
            color="#936"
            id="myFill"/>
    </fills>

    <geometry>
        <RoundedRectangleComplex
            state="upSkin"
            width="{awidth}"
            height="{aheight}"
            bottomLeftRadius="10"
            bottomRightRadius="20"
            topLeftRadius="15"
            fill="{myFill}" />
        <RoundedRectangleComplex
            state="overSkin"
            width="{awidth}"
            height="{aheight}"
            fill="{myFill}" />
    </geometry>
           
</GraphicBorderSkin>

<code>

 

There's some AS at the top, but that's the jist of stateful skinning of a button. degrafa FTW!

 

Session Survey update

I'm really enjoying working on this thing, I really hope other conference organizers can take it and 1. make it better, and 2. make use of it for their events. If for no other reason, than to stop using so much paper.

I've been working on it a lot this week, while I figure out what I want to do next. I've incorporated Rich's UpdateManager so that deploying new versions of the session Survey will be WAY easier!

I've also updated the DB to support multiple events, so now in the configuration file you can specify the ID of the event (among other things) so reusing the app is much easier, with much less coding.

Speaking of config files, I've beefed it up a bit. It started out just holding the location of the backend server, and such. Now you can give your app a title, point to a specific DSN name in your backend, and tell the app where to look for updates.

You can also tell when you're online or off now. There's a little icon that changes from green to red depending on network connection. Network status really confused a lot of people who submitted several not realizing they were offline, and the app not providing proper feedback about saving online. It does that now too.

I'm pretty happy with it and am working with Sim to get it hosted, trac'ed, etc so folks can start submitting bugs, enhancements, etc I'm really hopeful that this app can help Greenify conferences, and improve the feedback we can provide to speakers. Using this tool, Tom and I gave our 360|Flex Atlanta speakers feedback in just about a week of the conference ending, w00t!

 

Stay tuned for the official announcement.

What's the best way to Open Source a project

I'm still working on cleaning up the Survey app to release to the Open Source Community. I'm putting in a few more features I think it should have as a minimum set, but I'm curious. What's the best way to release?

SQL scripts? Dummy data?

I'm leaning towards just SQL scripts. The Dummy data I would provide would be Conference days, Time slots, things like that.

This being my first time putting something out into Open Source, I'm curious what the best approach is.

Any help would rock, I'm hoping that I'll be able to upload it to RIAforge next week sometime. Fingers crossed!

SQLite and AIR apps with Cairngorm

Having never done any SQLite stuff prior to the session survey, building it was a definite learning experience.

The hardest part of building with SQLite I think, is working with existing data. Writing data for later retrieval, cake. retrieving "offline" data, that was a bit more labor.

To start, populating the SQLite DB, isn't fun. I bought an off the shelve tool, SQLite Manager, that I like a whole lot. It supports SQLlite 2 and 3.

I'm not sure, but I'm guessing it's the nature of SQLite files, that once you've created the table and started working with it, making changes to structure, ain't possible.

I suppose since it's a flat file of some sort, making structure changes once populated, wouldn't be possible, but still a pisser. LOL.

Make sure when you create your "offline" tables, you know what you want.

For the survey app, we needed users to be able to still pick a track, and still pick a session from that track.

 

Tom and I ended up making our Cairngorm commands dual prupose. Getting on and off line data. Detecting whether the user is connected as a simple matter of implementing a URLMonitor to ping our site.

The command, looks for our global "am I online" var, and if we're not online, executes the SQLite functionality.

 

In order to make the commands as loosely coupled (for lack of a better term) to being on or off-line, we made the SQL result handler, call the command's normal result. From there the result() looks to see what type of result it's getting, since delegate sends a different type of result Object, than the SQL connection does. From there, it's a matter of formatting the data and storing it.

Our execute() looks like

if (model.networkConnection)
            {
                var delegate:SurveyDelegate = new SurveyDelegate(this);
           
                delegate.getTracks();
            } else {
                var connection:SQLConnection = new SQLConnection();
                var dbFileString : String = "360Survey.sqlite";
               
                var dbFile = File.applicationDirectory.resolvePath(dbFileString);
               
                connection.open(dbFile);
                var sqlQuery:String = "SELECT trackID, trackTitle, trackShortName FROM tbl_tracks";
                dbStatement.sqlConnection = connection;
                dbStatement.text = sqlQuery;
   
                dbStatement.addEventListener(SQLEvent.RESULT, onRetrieveDataResult);
                dbStatement.addEventListener(SQLErrorEvent.ERROR, onDBError);
   
                dbStatement.execute();
               
               
            }

Then the result() does the "what did I just get" logic.

public function result(data:Object):void
{
    trace('[GetTracksCommand] - Result');
    var resultData:ArrayCollection = new ArrayCollection();
    var tmpAC:ArrayCollection = new ArrayCollection();
        
    if (data.hasOwnProperty("result")) {
        resultData = data.result;
        } else {
            resultData = new ArrayCollection(data.data);
        }

I was a bit worried that it would be harder to build a connection aware application, especially since Tom and I didn't really start writing code, until about 2 weeks out from Atlanta. There's still a few things to re-factor in the code, and get cleaned up, but I think when we put this app out into the Open Source domain, other conferences will be able to easily modify it to their needs, they'll need a CF backend, unless they want to replace the CFCs with .NET, PHP or Java whatever, but hey, it'll be a starting place.

 

 

 

 

360|Flex Session Survey App

I'm looking for some ideas on what everyone would like to see in the Session Survey. Give me your ideas...

So I'm spending some of my down hours while I work on my next gig working on the session Survey App.

Our launch during the conference went ok, a few bugs, nothing too bad. Now it's time to clean up and enhance. I'm thinking we'll try to get it to a nice 1.0 place, and then put it up on RIAforge. I wanted to put a few more security measures, and user experience enhancements.

I also wanted to get anyone's input on what they'd like before it goes, Open Source.

I'm working on validating Attendee ID, so we can minimize crap data. Then I'll work on setting your ID into a shared Obj for persistence, maybe just us SQL Lite? I dunno.

I'm also going to improve the user feedback, when the app is working in "offline mode" maybe a cool status light or something? Also will make sure the save complete dialog shows up in both modes, not just 'online'

Besides those three things, what would ya'll want in a survey app for conferences?

If you're an attendee, let me know what you think of the app, no holds barred. I know it's rough, shoot! Tom and I worked on it off and on just the last week or two leading up to the Conference. You know the saying about the mechanic having the crappiest car.

I'm excited to get it buttoned up enough to put up on RIAforge, it'll be my first OS project... yippy! I'm really hoping others will jump in to help improve conferences of any type.  Part of the release will include the DB design, you'll need to create your own SQL lite DB for offline mode, with your own data, sorry, can't give out our attendee info.

It's not too late to show off your mad skills at 360|Flex

The API contest is up and running, you ain't even got to be there to win, though, we'd sure like to meet you if you do win!

The contest site is pretty straight forward; build a cool app, upload or link to it, explain it, tell us what API you used.

It's that simple! Next week, we'll roll out the voting portion of the app, let everyone vote on the app(s) they like. We'll announce the winners at 360|Flex Atlanta.

There's all sorts of cool prizes, and categories, take a look here. Plus all those cool sponsors are running their own contests, so you can enter your app in more than one, none of that "one entry per household crap." LOL.

We've got no limitations on our contests, but the sponsors do, so make sure if you plan to enter their contests too, check the rules.

Wanna know when Flex 3 will be released

I know, and while I'm not gonna say, I will say that being at 360|Flex Atlanta will be a really good place to find out.

Sure there are rumors; Apple will release a new PDA, Yahoo will be bought by Wal-Mart (no not really, but wouldn't surprise me), etc. but I have it on pretty good authority, that Adobe will have some super big news for us all, and it'll be right around 360|Flex Atlanta REDACTED.

 

As if the kick ass speakers and really great sponsors weren't enough. As if the 1gb USB flash drive we're using instead of lame ass CD's wasn't enough. Now missing 360|Flex Atlanta could mean you'll miss out on being part of some really big news. How much would that suck?!

 

See ya there!

Like contests Like sweet prizes

Then head over to the 360|Flex blog, where Tom and I just announced the submission site for our API contest. I won't prattle on about the guidelines, and such, read the post for those. I will say that we're hoping the API contest becomes a recurring theme at 360|Flex, taking a small handful of cool community API's and providing a stage for developers to build stunning, kick ass apps. The inspiration for the contest was all Chuckstar, I'm sure it had nothing to do with Ribbit being one of our API sponsors :)

I like the contest idea a lot. This time we were a little rushed, Nick from the Michigan Flex User Group stepped up and helped us out a bunch, by building the app for us. Hopefully in the future we'll be able to give a little more time for app building, but hey! we're not looking for a CMS or anything ;)

head over to the site, and take a look, the contest options are many, should be an option for anyone looking for something to fill some spare cycles with.

 

Flex and AIR Pre-release tour tonight in Denver

If you're in the area, come take a look, should be a cool event, lots of schwag, lots of people, should be fun.

Details here.


Kevin Hoyt will be on hand, giving some great demos.

 

SEE YOU THERE!

 

SmallWorlds Second life, but in Flex, and smaller

THE Ryan Stewart hooked me up with an invite to SmallWorlds, It's pretty cool, I'm not sure how much I'll use it, but I had fun setting up my pad, while I watched TV tonight.

It's a pretty dope little app, and certainly a bitchin' Flex app! I'm thoroughly impressed, good work guys!

I'll make sure to book mark it and check in from time to time, I'm interested to find out what the model is behind it, what's the point? What's the monetary strategy? I'm guessing it'll be like SecondLife and in order to get spending money you'll have to put money in, or make it somehow?

Wonder if they'll make an AIR version? A direct SecondLife competitor?

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.