/*Calendar Chart*/ gchart calendar temp date, title("SeaTac Average Temperature") gsize(12) /// gc(opac(0.75)) mfcolor(blue lawngreen) /// yrlabel(color(blue) bold) outline(color(orange)) /// molab(color(black))
0 Comments
In this example, we'll be customizing options so that our graph looks a lot more familiar.
sysuse sp500, clear /*Stata Scheme*/ gchart line high low date, /// lcolor(navy maroon) title("S&P 500 - Stata Color Scheme", color(#1e2d53) size(34) font("Arial") ) /// xtitle("Date", color(black) font(Arial) italic) ytitle("Price", color(black) font(Arial)) /// graphregion(fcolor(#eaf2f3, html)) plotregion(fcolor(white)) /// xlab(#7, glcolor(white)) ylab(#6,glcolor(#eaf2f3) angle(90)) legend(position(bottom))
Giving us the following graph:
We plan on adding a scheme(stata) option in a future release of gcharts. In the meantime, help files will list the color/axis/grid options for rendering Stata-looking graphs.
twoway area change date /*Area*/ gchart area change date, ytitle("Closing price change") xtitle("Date") /// title("Area Chart") /*Stepped Area*/ gchart area change date, ytitle("Closing price change") xtitle("Date") /// title("Stepped Area Chart") step twoway bar high low date gchart column high low date, title("Column Chart") gchart bar high low date, orientation(horizontal) title("Horizontal Bar Chart") sysuse sp500, clear gchart scatter open close date, msymbol(star triangle) msize (medium 10) /// title("S&P 500", bold italic) xtitle("Date", color(blue)) ytitle("Prices", color(green)) sysuse sp500, clear twoway line low high date, title("S&P500", color(blue) bold) /// lcolor(red blue) lwidth(thick medthick) lpattern(dash_dot solid) gchart line low high date, title("S&P500", color(blue) bold) /// lcolor(red blue) lwidth(thick medthick) lpattern(dash_dot solid) |
Aboutgcharts is a a program we co-wrote. This page is a portfolio of some basic examples. We will be adding more (complicated) examples shortly. AuthorsBelen Chavez Examples |