MCPcopy Index your code
hub / github.com/MapServer/MapServer / msDrawVBarChart

Function msDrawVBarChart

mapchart.c:129–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129int msDrawVBarChart(mapObj *map, imageObj *image, pointObj *center,
130 float *values, styleObj **styles, int numvalues,
131 float barWidth)
132{
133
134 int c;
135 float left,bottom,cur; /*shortcut to pixel boundaries of the chart*/
136 float height = 0;
137
138 for(c=0;c<numvalues;c++)
139 {
140 height += values[c];
141 }
142
143 cur = bottom = center->y+height/2.;
144 left = center->x-barWidth/2.;
145
146 for(c=0;c<numvalues;c++)
147 {
148 drawRectangle(map, image, left, cur, left+barWidth, cur-values[c], styles[c]);
149 cur -= values[c];
150 }
151 return MS_SUCCESS;
152}
153
154
155int msDrawBarChart(mapObj *map, imageObj *image, pointObj *center,

Callers 1

msDrawVBarChartLayerFunction · 0.85

Calls 1

drawRectangleFunction · 0.85

Tested by

no test coverage detected