/*
	qchi

*!  VERSION 1.1.3  03aug2006  (deprecated)

*/

VERSION 9.0

INCLUDE graph_header
INCLUDE header

HELP hlp1, view("help qchi")
RESET res1

DIALOG main, tabtitle("Main")						///
	label("qchi - Quantiles of chi-squared distribution plot")
BEGIN

  TEXT     tx_var       _lft       _top       _iwd	 .,		///
	label("Variable:")
  VARNAME  vn_var       @          _ss        _vnwd      .,		///
	label("Variable")

  GROUPBOX gb_opts      @          +35        _cwd1      _ht6,		///
	label("Options")

  CHECKBOX ck_grid      _ilft      _ms        _cwd3      .,		///
	option(grid)							///
	label("Add grid lines at percentiles 5, 10, 25, 50, 75, 90, and 95")

  SPINNER  sp_df        @          _ls        _spwd      .,		///
	label("Degrees of freedom")					///
	min(1) max(1000000) default(1)					///
	option(df)
  TEXT     tx_df        _spsep     @          _spr2b     .,		///
	label("Degrees of freedom")
END

INCLUDE ifin
INCLUDE p1_opts
INCLUDE line_opts
INCLUDE addplot
INCLUDE gr_twoway

SCRIPT PREINIT
BEGIN
	script p1_opts_createAsNoRange
	script p1_opts_setDefaultScatter
END

PROGRAM command
BEGIN
        put "qchi "
        varlist main.vn_var
        INCLUDE _ifin_pr
        beginoptions
                option main.ck_grid
                optionarg /hidedefault main.sp_df
		put " " /program p1_opts_recast_output
		put " " /program line_opts_rlopts_output
		put " " /program addplot_output
		put " " /program gr_twoway_output
        endoptions
END
