Loading ...
Sorry, an error occurred while loading the content.

Display Only Selected Labels for Bar Graphs?

Expand Messages
  • schonbach
    I am creating a stacked horizontal bar graph to display various categories as a percentage of the whole (in other words, the sum of all categories for each
    Message 1 of 2 , Dec 5, 2005
    • 0 Attachment
      I am creating a stacked horizontal bar graph to display various
      categories as a percentage of the whole (in other words, the sum of
      all categories for each object is 100%). I'd like to label each
      segment, however, some segments (e.g. those with small values) are too
      small to hold the label, so it overlaps into the adjacent segments.

      Is there a way to selectively print labels for segments, e.g. "only
      print the label if the value is >10.0"?

      The only way I've found so far is to define another field for each
      segment and set that field to the desired label (either "nn.nn%" or
      "") and then use labelfield. But then I have twice as much data in my
      script, and it gets messy (I already have ~75 datafields, and 115 rows
      of data).

      If you'd like to see some examples of the script I am writing, or a
      graphic example of what I'm talking about, please let me know.

      Thank you.
    • Stephen C. Grubb
      Hi, I understand your question. A labelselect attribute, where you could specify a condition for label printing, would be useful.. I ll add it to my todo
      Message 2 of 2 , Dec 8, 2005
      • 0 Attachment
        Hi,

        I understand your question. A "labelselect" attribute, where you could
        specify a condition for label printing, would be useful.. I'll add it to
        my todo list.

        One possible immediate solution would be to generate your bars with no
        labels, then use proc scatterplot to render text labels, and use "select"
        to control which labels are rendered. You can use "textdetails:
        adjust=..." to fine tune label position

        Steve



        On Mon, 5 Dec 2005, schonbach wrote:

        > I am creating a stacked horizontal bar graph to display various
        > categories as a percentage of the whole (in other words, the sum of
        > all categories for each object is 100%). I'd like to label each
        > segment, however, some segments (e.g. those with small values) are too
        > small to hold the label, so it overlaps into the adjacent segments.
        >
        > Is there a way to selectively print labels for segments, e.g. "only
        > print the label if the value is >10.0"?
        >
        > The only way I've found so far is to define another field for each
        > segment and set that field to the desired label (either "nn.nn%" or
        > "") and then use labelfield. But then I have twice as much data in my
        > script, and it gets messy (I already have ~75 datafields, and 115 rows
        > of data).
        >
        > If you'd like to see some examples of the script I am writing, or a
        > graphic example of what I'm talking about, please let me know.
        >
        > Thank you.
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >


        Stephen C. Grubb scg@... x-6633
        Scientific Software Engineer, The Jackson Laboratory
        600 Main Street Bar Harbor, Maine 04609 USA
      Your message has been successfully submitted and would be delivered to recipients shortly.