Comments (5)
Hi @majerus! Thanks for try/test the package.
First of all. In the future, can you style/format the code? It's easy, just ``` at the begginig and at the end. So it's easy for who read your code.
Ok. You can specify the margins with hc_chart
and enabled the exporting with hc_exporting
(by default is false).
Can you try this code and tell me if it help you?
mtcars %>%
group_by(cyl) %>%
summarise(ave_mpg = mean(mpg)) -> tmp
hc <- highchart() %>%
hc_add_theme(hc_theme_chalk()) %>%
hc_chart(margin = c(50, 100, 150, 200)) %>%
hc_title(text = "Example", style = list(color = "#F3F2F2")) %>%
hc_subtitle(text = paste("Example Date", Sys.Date()-1),
style = list(color = "#F3F2F2", fontWeight = "bold")) %>%
hc_xAxis(categories = tmp$cyl) %>%
hc_add_series(name = "mpg", type = "column", color = "#002878", showInLegend = FALSE,
dataLabels = list(align = "center", enabled = TRUE, format = "", color = "#F3F2F2"),
data = tmp$ave_mpg) %>%
hc_tooltip(crosshairs = TRUE, shared = TRUE, valueSuffix = "") %>%
hc_yAxis(title = "mpg", minorGridLineWidth = 0, gridLineWidth = 0, labels = list(format = ""), max = max(tmp$ave_mpg))
# without Download Menu
hc
# with Download Menu
hc %>% hc_exporting(enabled = TRUE)
from highcharter.
Thank you and sorry for forgetting to format the code.
This is close to what I am hoping to figure out. Is it possible to remove the padding around the graph as well? In the link I shared there is no white-space padding around the graph. Is that possible in the R implementation?
Thanks for the quick response. Again, this is impressive work.
Rich
from highcharter.
Do you ask who to remove the padding when you use saveWidget, right?. htmlwidget
have a template which add some padding to the resulting html. When you have your html you can edit and add other script tag after all the script tags and add:
<script>
$(document).ready(function () {
$("div").css("top", 0).css("left", 0).css("right", 0).css("bottom", 0)
});
</script>
This will remove all the padding for all the divs and will be no more white space ;)!
Before:
After:
I hope this is what you need XD.
from highcharter.
Thanks. I was able to tweak the html manually to accomplish this. I am
hoping to find a way to do this within the r-script because the actual
script sends a query, runs an analysis and produces this a graph daily.
Rich
On Wed, Feb 10, 2016 at 2:56 PM, Joshua Kunst [email protected]
wrote:
Do you ask who to remove the padding when you use saveWidget, right?.
<script> $(document).ready(function () { $("div").css("top", 0).css("left", 0).css("right", 0).css("bottom", 0) }); </script>
htmlwidget have a template which add some padding to the resulting html.
When you have your html you can edit and add other script tag after all the
script tags and add:This will remove all the padding for all the divs and will be no more
white space ;)!Before:
[image: image]
https://cloud.githubusercontent.com/assets/56481/12959825/068571ac-d017-11e5-835e-68b1cb37f264.pngAfter:
[image: image]
https://cloud.githubusercontent.com/assets/56481/12959839/14ddd974-d017-11e5-9465-d2a244069f42.pngI hope this is what you need XD.
—
Reply to this email directly or view it on GitHub
#39 (comment).
Rich Majerus
richmajerus.com
from highcharter.
I guess you can code this functionality ;)!
I'm closing the issue.
from highcharter.
Related Issues (20)
- Bugs in highcharter maps HOT 6
- defs to define gradient zones in styledmode
- Charts with `highchartOutput2` not rendering
- Feature Request: Add TiledWebMap module functionality / Upgrade Highcharter Version
- Drilldown breadcrumbs
- Installation issues witth the package highcharter HOT 4
- Timezone adjustment via time object, using hchart()
- deprecated function unite_()
- Upgarde to HighchartsJS 11.2.0
- Output valid JSON only
- hc_exporting converts plot to dark mode HOT 2
- Docker build fail HOT 2
- Different scales for different variables in polar charts HOT 1
- Highcharter under r-shinylive HOT 1
- hcaes_string() doesn't work due to conflicts with other packages HOT 1
- Pie chart onPoint option not working as expected on hcmap/Feature request: update highcharts
- Create wordcloud output like wordcloud2 output style
- Add title to `hw_grid`
- Feature: enable color sea / oceans option - hc_add_series
- in Maps, the dashed borders have a scaling issue when zooming in and which only disappears if you hover your mouse over the lines.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highcharter.