\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Dhanush M V (dmvohyeah)} \pdfinfo{ /Title (highcharter.pdf) /Creator (Cheatography) /Author (Dhanush M V (dmvohyeah)) /Subject (Highcharter Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{0755A3} \definecolor{LightBackground}{HTML}{EFF4F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Highcharter Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Dhanush M V (dmvohyeah)} via \textcolor{DarkBackground}{\uline{cheatography.com/126472/cs/24495/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Dhanush M V (dmvohyeah) \\ \uline{cheatography.com/dmvohyeah} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 27th September, 2020.\\ Updated 27th September, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Highcharter Cheat Sheet}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Made by:- \newline % Row Count 1 (+ 1) {\bf{Name:}} Dhanush M Vajravelu \newline % Row Count 2 (+ 1) {\bf{Regno:}} 18BCE2071% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Intro}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{R package is a wrapper for the 'Highcharts' library including shortcut functions to plot R objects.} \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Installation \& Use}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Installation}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{install.packages("highcharter")} & {\emph{To install Highcharter}} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Load}}} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \seqsplit{library(highcharter)} & {\emph{Load Highcharter library at the beginning of the code}} \tn % Row Count 7 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Useful functions}}} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} highchart() & {\emph{This function creates a Highchart chart using htmlwidgets}} \tn % Row Count 11 (+ 3) % Row 6 \SetRowColor{LightBackground} hchart() & {\emph{This function to draw different charts on the fly}} \tn % Row Count 14 (+ 3) % Row 7 \SetRowColor{white} hc\_add\_series() & {\emph{Adds data to existing objects (useful for discrete graphs like scatter plot)}} \tn % Row Count 18 (+ 4) % Row 8 \SetRowColor{LightBackground} hc\_chart() & {\emph{Chart options for highcharter objects}} \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} hc\_labels() & {\emph{Labels options for highcharter objects}} \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} hc\_legend() & {\emph{Legend options for highcharter objects}} \tn % Row Count 24 (+ 2) % Row 11 \SetRowColor{white} hcmap() & {\emph{Shortcut to access the Highcharter map library from \seqsplit{https://code.highcharts}.com/mapdata/}} \tn % Row Count 29 (+ 5) % Row 12 \SetRowColor{LightBackground} hc\_add\_theme() & {\emph{To add Predefined themes}} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Installation \& Use (cont)}} \tn % Row 13 \SetRowColor{LightBackground} export\_hc() & {\emph{Function to export js file the configuration options}} \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{{\bf{Using Hchart()}}}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline % Row Count 1 (+ 1) hchart(object, ...)% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Bar Plot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601222903_bar.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline {\emph{hchart(type = "bar")}} \newline \newline {\bf{Code}} \newline {\emph{ pokemon\%\textgreater{}\%}} \newline {\emph{ count(type\_1)\%\textgreater{}\%}} \newline {\emph{ arrange(n)\%\textgreater{}\%}} \newline {\emph{ hchart(type = "bar", hcaes(x = type\_1, y = n))}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Column Plot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601223032_column.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline {\emph{hchart(type = "column")}} \newline \newline {\bf{Code}} \newline {\emph{ pokemon\%\textgreater{}\%}} \newline {\emph{ count(type\_1)\%\textgreater{}\%}} \newline {\emph{ arrange(n)\%\textgreater{}\%}} \newline {\emph{ hchart(type = "column", hcaes(x = type\_1, y = n))}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Treemap}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601223123_Treemap.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline {\emph{hchart(type = "treemap")}} \newline \newline {\bf{Code}} \newline {\emph{ pokemon\%\textgreater{}\%}} \newline {\emph{ count(type\_1)\%\textgreater{}\%}} \newline {\emph{ arrange(n)\%\textgreater{}\%}} \newline {\emph{ hchart(type = "treemap", hcaes(x = type\_1, value = n, color = n))}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Using hc\_chart()}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline % Row Count 1 (+ 1) hc\_chart(hc, ...)% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Area Chart}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601225469_area.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline {\emph{hc\_chart(type = "area") \%\textgreater{}\%}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{{\bf{Using hc\_add\_series()}}}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline % Row Count 1 (+ 1) hc\_add\_series(hc, data = NULL, ...)% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Scatter Plot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601225035_Scatter.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline {\emph{hc\_add\_series({\bf{data}}, "type = scatter")}} \newline \newline {\bf{Code}} \newline {\emph{highchart()\%\textgreater{}\%}} \newline {\emph{ hc\_add\_series(pokemon, "type = scatter", hcaes(x = height, y = weight))}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{{\bf{Using hc\_add\_theme()}}}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Syntax}} \newline % Row Count 1 (+ 1) hc\_add\_theme(hc, hc\_thm)% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Theming using hc\_theme\_chalk}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601224617_chalk.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Code}} \newline {\emph{highchart()\%\textgreater{}\%}} \newline {\emph{count(type\_1)\%\textgreater{}\%}} \newline {\emph{arrange(n)\%\textgreater{}\%}} \newline {\emph{ hc\_add\_series(pokemon, "type = scatter", hcaes(x = height, y = weight))}} \newline {\emph{hc\_add\_theme(hc\_theme\_chalk())}} \newline \newline \newline {\bf{Other themes with Highcharter}} \newline hc\_theme\_db \newline hc\_theme\_economist \newline hc\_theme\_flat \newline hc\_theme\_ft \newline hc\_theme\_ggplot2 \newline hc\_theme\_handdrawn \newline hc\_theme\_chalk \newline hc\_theme\_flatdark \newline hc\_theme\_superheroes \newline hc\_theme\_google} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Using hmaps()}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Usage}} \newline % Row Count 1 (+ 1) {\emph{hcmap(map, download\_map\_data, ...)}} \newline % Row Count 2 (+ 1) Map - String indicating what map to chart, a list from \seqsplit{https://code.highcharts.com/mapdata/.} \newline % Row Count 4 (+ 2) download\_map\_data - A logical value whether to download (add as a dependency) the map.% Row Count 6 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Map Download}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dmvohyeah_1601225882_map.JPG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Code}} \newline {\emph{hcmap("https://code.highcharts.com/mapdata/countries/in/in-all.js")\%\textgreater{}\%}} \newline {\emph{ hc\_title(text = "India")}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}