Archive for December, 2009

Radar Charts

Tuesday, December 1st, 2009

radar2

PLOT RADARCHART
     DIRECTION, RED TRIANGLE,
     DIRECTION, BLUE VECTOR
   WITH
    NO LABELS Y
    FRAMECOLOR RGB(230,230,255)
    GRIDLINES
SELECT peak_wind_dir, peak_wind_speed, wind_dir,
   wind_speed
    FROM raws_bl
    WHERE dt > DATE_SUB(NOW(), INTERVAL 24 hour);

Entrance IDE 1.5 is available for download now, with support for drawing radar charts like the one above. (Radar charts are not supported by the current community version)

To plot data using a radar chart specify a DIRECTION column containing angles in degrees 0-360 and a data value column to use for plotting VECTOR, LINE, AREA or one of the marker types.

Radar charts use the settings for the y axis to determine distances from the center of the chart circle. The y scale can be autoscaled or set manually using
SCALE Y (min) (max) (increment)

Use the SCALE X to control the spacing between ticks and radial gridlines. Use [NO] LABELS Y to determine whether to label the scaling circles and and use [NO] LABELS X to determine whether to draw labels around the outer circle..

This example mixes an AREA type column with a LINE:

radar

PLOT RADARCHART
     DIRECTION, GREEN AREA
     DIRECTION, BLUE LINE
    WITH
     NO LABELS Y
     FRAMECOLOR rgb(230,230,255)
     GRIDLINES
SELECT peak_wind_dir, peak_wind_speed, wind_dir,
      wind_speed
     FROM raws_bl
     WHERE dt > DATE_SUB(NOW(), INTERVAL 24 hour);

COLOR and SIZE OVERRIDES, LEGENDs and TITLES are supported, and RadarCharts support any of the line and marker types, TRIANGLE, BOX, and so on, as well as bubble effects.

Points in a radar chart can labelled using DATALABELs.   (DATALABELs are drawn next to points specified by the previous DIRECTION, VECTOR series)  

Use DATALABEL and VECTOR with radar charts to make gauges like these in a dashboard (click on a gauge to see the script that made it):

gauge1gauge5gauge4gauge3.png

Some details:
In a radar chart, DIRECTION 0 is always straight up, and increases clockwise: e.g. 90 degrees is to the right, 270 degrees is to the left, and so on. To make different scales like the meters you see above, you’ll need to cheat: use NO LABELS X to turn off the auotmatic labels and make your own using a DATALABEL column.

See also: Entrance IDE 1.5 also supports DatetimeDirCharts, which plot direction changes on a datetime axis: see “Plotting Wind Direction and Speed” for the details.

Entrance home page: http://dbentrance.com/
Plot syntax: http://dbentrance.com/newdocs/plotsyntax.html

Copyright (c) 2009 dbEntranceSoftware, All Rights Reserved