Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Chart Font Sizes in Shiny #40

Open
phillc73 opened this issue Dec 16, 2015 · 2 comments
Open

Adjust Chart Font Sizes in Shiny #40

phillc73 opened this issue Dec 16, 2015 · 2 comments

Comments

@phillc73
Copy link

I'm struggling to understand how to adjust chart font sizes for a metricsgraphics chart in Shiny. I've read the documentation, examined the functions and tried StackOverflow without finding a solution for this one.

Below are two examples of the same chart, generated with the same code.

In RStudio:

rsf-rstudio

In the Shiny app:

rsscatter

As you can see the axis labels, marker and baseline font sizes are different. The ones in RStudio are OK, the ones in Shiny a bit small.

I've tried adjusting chart dimensions and padding, but neither made a difference.

Example code:

  rsScatter %>%
    mjs_plot(x=FBRV, y=RSF, left = 20, bottom = 20, top = 10) %>%
    mjs_point(color_accessor=FBRr, 
              size_accessor=BFOdds, 
              least_squares=TRUE,
              size_range=c(3, 50),
              color_type="category",
              point_size=1,
              color_range=rev(brewer.pal(n=9, name="Greens"))) %>%
    mjs_labs(x="FBR V%", y="RSF") %>%
    mjs_add_baseline(1.25, "RSF 1.25") %>%
    mjs_add_marker(0, "FBR V: 0%") %>%
    mjs_add_mouseover("function(d, i) {
               $('#rsf svg .mg-active-datapoint')
                   .text(d.point.COURSE + ' ' + d.point.TIME + ': ' + d.point.HORSE + ' | FBRr: ' + d.point.FBRr + ' | FBR: ' + d.point.FBR + ' | FBR V: ' + d.point.FBRV + '%' + ' | RSF: ' + d.point.RSF +' | BF Odds: ' + d.point.BFOdds);
                }")
@hrbrmstr
Copy link
Owner

can you dput(rsScatter) as well? (TIA)

@phillc73
Copy link
Author

How about an rds file of today's actual rsScatter data? I thought that might be most useful for debugging. (Sorry, it's zipped. GitHub doesn't allow direct rds file uploads)
rsScatter.zip

Also should have mentioned, I'm using RStudio Version 0.99.484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants