Opened 17 years ago

Closed 16 years ago

#2136 closed defect (fixed)

Add ability to read chart size from an attribute

Reported by: dmorissette Owned by: tbonfort
Priority: normal Milestone: 5.2 release
Component: MapServer C Library Version: 5.0
Severity: normal Keywords:
Cc: dmorissette

Description (last modified by tbonfort)

During the questions/comments period of RFC-29 (Dynamic Charting Capability, see also ticket #1800), one of the questions raised was whether we could provide the ability to bind the chart size to an attribute.

This would be a nice to have but will not be included in the initial RFC implementation. Instead I propose that we keep this as a future enhancement. Here is the approach that I proposed on the mapserver-dev list:

I've thought about this some more. It is probably not sufficient to provide the ability to lookup the chart size in an attribute, since this attribute may not be a value in pixels but would be an actual value (e.g. total amount of sales) so you really need to be able to define a range of sizes for the chart which is driven by an attribute.

We could be to keep PROCESSING CHART_SIZE as is, and define a second mechanism to specify the chart size:

 PROCESSING "CHART_SIZE_RANGE = itemname minsize maxsize minval maxval"

where:

  • itemname is the name of the attribute that drives the chart size (e.g. total_sales)
  • minsize and maxsize are the minimum and maximum chart size values in pixels (e.g. "10 100")
  • minval and maxval are the minimum values of the attribute that correspond to chart sizes of minsize and maxsize (e.g. 10000 1000000).

If the attribute value is smaller than 'minval' then the chart size will be minsize pixels, and if the attribute value is larger than maxval, the chart size will be maxsize pixels.

Change History (5)

comment:1 by dmorissette, 17 years ago

Description: modified (diff)

comment:2 by dmorissette, 17 years ago

Cc: t added

comment:3 by dmorissette, 17 years ago

Cc: tbonfort added; t removed
Milestone: FUTURE5.2 release
Version: 5.0

comment:4 by tbonfort, 16 years ago

Cc: dmorissette added; tbonfort removed
Description: modified (diff)
Owner: changed from dmorissette to tbonfort

support for setting the diameter of pie charts from an attribute have been committed in r6962 . the same functionality for bar charts has not been implemented as

  • there are two variables to change (width /and/ height) => we'd need additional processing keywords
  • the concept of dynamic size for a bar chart doesn't really make sense

this commit also supports setting

PROCESSING "CHART_SIZE_RANGE = itemname"

without the minsize,maxsize,minval,maxval values for when the diameter can be read directly from an attribute without need for rescaling

comment:5 by tbonfort, 16 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.