tau_title: Add a title to the tauchart plot

Description Usage Arguments Value Examples

Description

This provides a hack-ish way to add a title to a tauchart. Heed the warning in return well. This is the last function you should use when building a tauchart.

In interactive sessions this function uses htmltools::html_print to display the chart with title, otherwise it just returns the shiny.tag- classed object since that works well in R Markdown documents.

This is most certainly a temporary hack.

Usage

1
2
tau_title(tau, title = "", div_css = "width:100%",
  span_css = "font-weight:bold;margin:auto;text-align:center")

Arguments

tau

taucharts object

title

title for the chart

div_css

style to apply to the surrounding div. You should probably set the width here.

span_css

CSS style to apply to the title span. The default is to center-align the text and using a bold font. Go. Crazy. Not tested in a Shiny context yet

Value

THIS DOES NOT RETURN AN htmlwidget!! It returns a shiny.tag class HTML (the widget is wrapped in a <div>). It should be the LAST call in a magrittr pipe chain or called to wrap a streamgraph object for output

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
tauchart(mtcars) %>%
  tau_point("mpg", "wt") %>%
  tau_guide_y(auto_scale=FALSE) %>%
  tau_title("Some Really Good Plot Title",
            "font-weight:bold;margin:auto;text-align:center;font-size:24px;
            color:#7f7f7f;font-family:sans-serif")

tauchart(mtcars) %>%
  tau_point("mpg", "wt") %>%
  tau_guide_y(auto_scale=FALSE) %>%
  tau_title("Some Really Good Plot Title",
            "font-weight:bold;margin:auto;text-align:right;font-size:24px;
            color:#7f7f7f;font-family:sans-serif")

tauchart(mtcars, width="500px") %>%
  tau_point("mpg", "wt") %>%
  tau_guide_y(auto_scale=FALSE) %>%
  tau_title("Some Really Good Plot Title",
            "width:500px;font-weight:bold;margin:auto;text-align:left;
            font-size:24px;color:#7f7f7f;font-family:sans-serif")

hrbrmstr/taucharts documentation built on May 17, 2019, 5:14 p.m.