home

Boost Blog

Flex radar chart component

Posted by jeremy on May 6th, 2009

We’ve released a radar (spider, polar) chart component for Flex as an open source (MIT) project on github. This is abstracted from our Sonarhq product. For the most part we’ve been using the Flex Charting components from Adobe, but this doesn’t include radar charts. picture-5 We looked at several commercial packages, but these turned out to be either too expensive, or not flexible enough. There is a free component a vailable at Kap Lap, but it didn’t support the styles we needed to match the design we had.

In the end it was easier to produce our own (about a day and a half of work). The project depends on some common libraries we’ve developed at Boost over the last couple of years, which we haven’t decided on open sourcing yet, but we have included the binary under the same license so that the charting component can work. Here’s a demo and how to get going:

picture-2

Download the code or the swc [230KB] file from github and create a new project. In the project properties add the swc library or open the chart project and include it. Create an application with the following code:

  <![CDATA[
 
    private function init():void {
      radarChart.addAxis('bread');
      radarChart.addAxis('cheese');
      radarChart.addAxis('wine');
      radarChart.addAxis('fish');
      radarChart.addAxis('meat');
 
      radarChart.addSeries('Male', {bread: 3, cheese: 4, wine: 5, fish: 1, meat: 4});
      radarChart.addSeries('Female', {bread: 4, cheese: 2, wine: 4, fish: 5, meat: 3});
    }
 
  ]]>

This will show a simple chart similar to the one here. The charts can be styled quite a bit. Take a look through the code to see the styles that can be applied. Note that I haven’t yet allowed for styling the bits of text.

Originally my intention was to extend the flex charting objects in order to implement the chart. Unfortunately I found the structure a bit complex, and documentation for extending non-existent. I’m sure it would have been possible, but I didn’t get very far and just wanted to just get it done.

Update 24th Aug 2009: New release that fixes issues with drawing the highlight and removing series radar_chart-1.1.swc.

Update 28th Oct 2009: New release that fixes removing labels when removing axis: radar_chart-1.2.swc.

Update 16th Jul 2010: Release that works correctly with Flex 4. This is for Flex 4 (Flash Builder 4) only, and will not work with Flex 3. radar_chart-1.3-flex4.swc.

Tags: flex flash as3 charting

This entry was posted on Wednesday, May 6th, 2009 at 1:37 pm and is filed under Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

16 Responses to “Flex radar chart component”

  1. Veith Zäch says:
    August 6, 2009 at 9:33 pm

    excellent work.

    But can someone tell me where to get boost flex common?
    github.com/boost/boost-flex-common do not work.

  2. Nathan says:
    August 6, 2009 at 10:20 pm

    Hi there, we haven’t released the source for the common library yet but the compiled library is included in the libs folder of the Radar Chart – http://github.com/boost/radar-chart/tree/8feef0513ffae94a5bc96b37edc3129656204483/libs

  3. Matt says:
    August 23, 2009 at 5:12 pm

    Thanks for putting this together, great solution! I am having problems with the removeSeries method, it doesn’t seem to be removing the series I added. Thanks for any insight.

  4. jeremy says:
    August 23, 2009 at 7:02 pm

    @Matt: I’ve pushed an update to fix the issue with removing series to the github repo. I’ll update the compiled version sometime in the next week. Cheers.

  5. P says:
    October 23, 2009 at 4:40 am

    Awesome job, thanks for making this available.

  6. Simon says:
    November 18, 2009 at 12:25 pm

    Hey!

    I’m having trouble getting this to compile,
    I get:
    Error: unable to load SWC boost_common.swc: could not find catalog.xml within the SWC.

    Any tips?

    Thanks!

  7. jeremy says:
    December 3, 2009 at 1:05 pm

    Please try downloading the library file from http://cloud.github.com/downloads/boost/radar-chart/boost_common.swc and including it in your project.

  8. flex2007 says:
    December 14, 2009 at 4:06 pm

    Can not found “common.charts.RadarChartSeriesEvent:” in swc.which Wrong?
    flex2007´s last blog – 我的域名会不会被和谐掉 My ComLuv Profile

  9. Mahesh says:
    March 6, 2010 at 12:41 am

    Hi

    i used radar_chart-1.2.swc. to create spider chart with 8 sides..

    i dont want to display series points on the line like 0 1 2 3 4 ….

    i want clean line apart from that i need to create a fencing for my spiderchat

    How can i acive that functionality…

    Please let me know

    Regards
    Mahesh

  10. jeremy says:
    March 6, 2010 at 9:33 am

    Hi Mahesh,

    There is no way to achieve turning off the labels using the swc file. However, it wouldn’t be difficult to implement if you download the original source code from http://github.com/boost/radar-chart and modify it to switch off the labels (see function updateAxis on line 330 of RadarChart.as).

    If you wanted to contribute this change back to the project the easiest way would be to create a free github account and fork the project.

  11. robertoeee says:
    May 12, 2010 at 11:46 pm

    Hi, I have many problems…

    I’ve tried with this example in a flex project importing to the project this project (http://github.com/boost/radar-chart):

    and into my application it show a dark rectangle, nothing more.

    I don’t know which is the problem. Maybe Flex’s version…

    Thanks in advance!

  12. jeremy says:
    May 17, 2010 at 11:20 am

    Hi,

    I haven’t tested the chart in Flex 4, only Flex 3. What version are you using?

    Jeremy

  13. jameskei says:
    June 1, 2010 at 8:46 pm

    Hi,

    Yes, I have tested this chart in flex4, but error occurred.

    I think when flex 4 sdk complile and running the app, the problem occur.

    error message looks like

    TypeError: Error #1009: null …
    at boost.charts::RadarChart/drawSerie()[C:\AES_FRAMEWORK\workspace\Test01\src\boost\charts\RadarChart.as:648]

    How can I solution this problem?

  14. jeremy says:
    June 4, 2010 at 3:31 pm

    Hi, the problem you’re having looks like it has to do with the array of colours provided to the chart.

    By default only 8 colours are available, so if you are adding more than 8 series you may get an error.

    You may also get an error if you have supplied a different set of colours.

    This solution would be to add a style tag to your applications main mxml file, making sure you specify enough colours for your series:


    RadarChart {
    colors: #257BB6, #B7247C, #CCC012, #41C04F, #296997, #26B69B, #CF5F0B, #A041C1;
    }

  15. jeremy says:
    July 16, 2010 at 1:48 am

    There is an update available that addresses the Flex 4 issues. Please check the updates section at the end of the post, or the github page for this project at http://github.com/boost/radar-chart

    Jeremy

  16. robert says:
    July 29, 2010 at 9:54 pm

    hi, I have a problem, how to change the bgcolor of radarchart? I want to the color is #FFFFFF.thank you!

Leave a Reply

Click here to cancel reply.

CommentLuv Enabledshow more

  • Categories

    • Agile (3)
    • assessment (2)
    • consumer trends (8)
    • Cool tools (5)
    • Curriculum (2)
    • cybersafety (1)
    • Design (6)
    • Development (14)
    • devices (2)
    • Drupal (1)
    • e-Learning (7)
    • e-learning research network (1)
    • informal learning (5)
    • inquiry (4)
    • key competencies (6)
    • learning communities (3)
    • magic and delight (5)
    • Maori achievement (2)
    • multiliteracies (1)
    • professional learning (6)
    • Publishing (3)
    • Random thoughts (3)
    • research (7)
    • Ruby on Rails (8)
    • Sarah's top ten (11)
    • Social media (7)
    • Social software: practices (5)
    • social software: tools (9)
    • software (4)
    • Software for Learning website (4)
    • student work (7)
    • teacher-learner roles (5)
    • teaching practice (9)
    • the curriculum (6)
    • transformation (10)
    • Usabilty (3)
    • Writing (1)
  • Archives

    • August 2010 (4)
    • July 2010 (6)
    • June 2010 (2)
    • April 2010 (1)
    • March 2010 (1)
    • February 2010 (1)
    • January 2010 (3)
    • December 2009 (1)
    • November 2009 (1)
    • October 2009 (4)
    • September 2009 (2)
    • August 2009 (3)
    • July 2009 (6)
    • June 2009 (3)
    • May 2009 (1)
    • April 2009 (6)
    • March 2009 (6)
    • February 2009 (11)
    • December 2008 (4)
    • November 2008 (6)
    • October 2008 (12)
    • September 2008 (7)
    • August 2008 (7)
    • July 2008 (4)
  • Boost Loves Design

    • I love Typography
    • IntuitionHQ | easy website usability
    • OMG It even has a watermark
    • Follow me on Twitter
    © Boost Limited.
    All rights reserved.
    CONTACT US
    info@boost.co.nz
    tel. (04) 939 0062
    fax. (04) 939 0063

    Level 6, 175 Victoria Street
    PO Box 11504, Wellington
    New Zealand