Missing option not showing missing data in graph (proc gchart)

Reply
Frequent Contributor
Posts: 106

Missing option not showing missing data in graph (proc gchart)

I want to plot the following data on a bar chart, where building ID is on the x-axis and value is the height of the bar. If the value is 0 or .  I want the building id to show up on the x axis. I am using the missing and discrete options, but the building ids where value = . do not show up. Only Building ID #s 1, 2, 3, and 6 show up on the x-axis. When subgroup=subgroup and the missing option (and discrete option is not used) I get buildings 1-6 for the green category, buildings 1-6 for the blue category, and buildings 1-6 for the yellow category, on the x-axis. Only buildings 1-6, divided into each category should show up on the x-axis.

building      value      subgroup

1                    22        green

2                    0          green

3                  44           blue

4                   .           yellow

5                    .          blue

6                     0        blue

Super Contributor
Posts: 543

Re: Missing option not showing missing data in graph (proc gchart)

Posted in reply to sarahsasuser

Hi,

try this:

axis1 order = 1 to 6 by 1;

proc gchart data = have;

    vbar building/ discrete missing sumvar = value maxis = axis1;

run;quit;

Does this look like what you'd want?

Good luck.

Anca.

Super Contributor
Posts: 358

Re: Missing option not showing missing data in graph (proc gchart)

Posted in reply to sarahsasuser

Since you are already using MISSING and DISCRETE, you can try OPTION MISSING=0 and see if this helps.

Frequent Contributor
Posts: 106

Re: Missing option not showing missing data in graph (proc gchart)

Posted in reply to sarahsasuser

Specifying the order of the building ids (order=) worked best as the real data isn't building 1-6, but buildings 1, 4, 24, 236, 444, etc. Thanks for your help.

Ask a Question
Discussion stats
  • 3 replies
  • 200 views
  • 0 likes
  • 3 in conversation