[mapserver-users] Graph only bar and pie without values?

elisabeth theresia dbee_kawai at yahoo.com
Sun Aug 29 07:21:35 EDT 2010


Thanks Forums, yesterday I already can appear graph from Mapserv vs 5.x

But, why just appear bar or pie without values?

Anyone can explain about the coding that should i write?

if i have mapfile with many layer and also many class, how to write it and 
display graph dynamic?

here the example:

i have 1 database with 4 tables (tA,tB,tC,tD), in one table has 4 fields but if
i want to display just 2 fields (region and total) from each table , how to 
write it down in Layer TYPE CHART?

if i wrote like this, it will display bar on the map all same, no short tall 
graph and all same pie, no part of it.

# tA
    LAYER
    #NAME "tA"
    STATUS DEFAULT
      
        TYPE CHART
        PROCESSING "CHART_TYPE=BAR"
        PROCESSING "CHART_SIZE=40 30" #specify size of the chart for pie or bar 
graphs
        #PROCESSING "CHART_SIZE=20 10" #specify width n height for graphs
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=xpassword=pass dbname=db host=localhost port=5432"
    DATA "the_geom FROM tA USING UNIQUE num"   ## HOW TO WRITE ?
    
    CLASS
        NAME "Region 1"
        TEMPLATE "./template_gender.html"
            EXPRESSION ([total]>=1000 and [total]<=2000)   # is it rite?
            STYLE
            SIZE [region]
            COLOR 255 255 0
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        
        CLASS
        NAME "Region 2"
        TEMPLATE "./template_gender.html"
            EXPRESSION ([total]>=2001 and [total]<=3000) 
            STYLE
            SIZE [region]
            COLOR 255 255 255
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        
END LAYER

############################################

# tB
    LAYER
    #NAME "tA"
    STATUS DEFAULT
      
        TYPE CHART
        PROCESSING "CHART_TYPE=BAR"
        PROCESSING "CHART_SIZE=40 30" #specify size of the chart for pie or bar 
graphs
        #PROCESSING "CHART_SIZE=20 10" #specify width n height for graphs
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=xpassword=pass dbname=db host=localhost port=5432"
    DATA "the_geom FROM tA USING UNIQUE num"   ## HOW TO WRITE ?
    
    CLASS
        NAME "Region 1"
        TEMPLATE "./template_gender.html"
            EXPRESSION ([total]>=1000 and [total]<=2000)   # is it rite?
            STYLE
            SIZE [region]
            COLOR 255 255 0
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        
        CLASS
        NAME "Region 2"
        TEMPLATE "./template_gender.html"
            EXPRESSION ([total]>=2001 and [total]<=3000) 
            STYLE
            SIZE [region]
            COLOR 255 255 255
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        
END LAYER
:
:
until 2 layers more that describe 2 tables.

Thanks all,

-Theresia :)



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100829/fefdf1b2/attachment.html


More information about the mapserver-users mailing list