Stacked Bars

stacked

    PLOT STACKEDBARCHART
        AXISLABELS,
          LIGHT BLUE BARS,LIGHT GREEN BARS,
            LIGHT RED BARS
      WITH
        TITLE "Test Scores"
        TITLE "Test Administered 4-25-07"
        TITLE "Epsilon Elementary School"
        TITLE ""
        TITLE Y "Count"
        TITLE X "Scores"
        LEGEND BOTTOM
    SELECT score,
        (SELECT COUNT(id)
          FROM testtemp where English = score)
          AS 'English Scores' ,
        (SELCT COUNT(id)
          FROM testtemp where Video = score)
          AS 'Video Game Scores' ,
        (SELECT COUNT(id)
          FROM testtemp where Math = score)            
          AS 'Math Scores'
      FROM ref_scores
      GROUP BY score
      ORDER BY score;

Use STACKEDBARCHART when you want bars to stack on top of each other.

Use BARWIDTH to change the width of the bars, eg. here is
BARWIDTH 0.25:

BARSEPARATION and BAROVERLAP will be ignored, but other Bar Chart settings are also supported by Stacked Bar Charts.

Comments are closed.