Bubble Charts


 
    CREATE TEMPORARY TABLE t(
        l VARCHAR(255), x DOUBLE, y DOUBLE,
      s INT, c VARCHAR(255)
    );

    INSERT INTO t
      VALUES('A', 10,10, 30, 'transparent light green'),
        ('B', 10,20, 40, 'transparent light yellow'),
        ('C', 20, 40, 120, 'transparent light blue'),
        ('D', 40, 60, 180, 'transparent light red'),
        ('E', 55, 50, 70, 'transparent light purple');

    PLOT SCATTER
        X, FILLED CIRCLE, DATALABELS CENTERED,
        SIZE OVERRIDE, COLOR OVERRIDE
      WITH
        SCALE X 0 75 25
        SCALE Y 0 120 40
        NO XAXIS
        NO YAXIS
        NO SIDES
    SELECT x,y, l, s, c
        FROM t;

To make a Bubble Chart, use SCATTER and assign columns for the SIZE OVERRIDE and COLOR OVERRIDE.

The color column should should contain an Entrance color name or the empty string for each row. The size column should contain an integer or null. (Size null causes nothing to be drawn)

Something similar can be used to make a Venn diagrams:


    CREATE TEMPORARY TABLE t(
        lc VARCHAR(255),
        x DOUBLE, y DOUBLE, s INT, c VARCHAR(255)
    );

    INSERT INTO t
        VALUES (
        ' LEFT',
          28, 15, 150, 'very trnasparent light blue'),
        ('RIGHT ',
          18, 15, 150,'very transparent yellow'),
        ('TOP',
          23, 33, 150, 'very transparent light red');

    PLOT SCATTER
        X, FILLED CIRCLE
        DATALABELS CENTERED,
    SIZE OVERRIDE, COLOR OVERRIDE
      WITH
        SCALE X 0 50 25
        SCALE Y 0 50 25
        NO XAXIS
        NO YAXIS
        NO SIDES
    SELECT x,y, lc, s, c
        FROM t;

Please note: Beginning with version 1.4.11, we have changed the units used for SIZE OVERRIDEs. The size is now specified in virtual page coordinates, 1-1000, with 1000 equal to the full width of the current page. With the desktop window sized for the full screen you won’t see much change. However, “bubbles” can now resize nicely to fit on small pages, like iPhone screens.

Comments are closed.