Comments (10)
@Funnng covert the UTF8 character to native might help
from highcharter.
I guess it's something related to the handling of R object to JSON.
Note, if I remove the last Chinese character 类
, the code works fine, i.e.:
library(magrittr)
r <- data.frame(a = 1:3, b = c("a", "b", "c"))
highcharter::highchart() %>%
highcharter::hc_chart(type = "column") %>%
highcharter::hc_xAxis(categories = r$b) %>%
highcharter::hc_add_series(data = r$a, name = "权益")
from highcharter.
I guess it's not an error related to your package, because I find that the DT
can't work as well.
DT::datatable(data.frame(name = "权益类"))
So, feel free to close this issue if you end up with the same conclusion. Thanks!
from highcharter.
@jbkunst Sorry, after I reboot my PC, the issue is gone... Sometimes, the best solution in Windows is rebooting... So, I'll close this issue.
from highcharter.
😆 Sometimes? Always!
Regards
from highcharter.
i got the same problem on centos.
from highcharter.
Hi @Funnng,
If you have the same message/error:
Error in gsub("</", "\\u003c/", payload, fixed = TRUE) :
That line belogs to the htmlwidgets
package (see line here)
So I'm not sure how I can help you. Have you tried removing special characters?
from highcharter.
i tried the code below and it show nothing, and i check the console log in chrome and found this error.
highchart() %>% hc_add_series_treemap(treemap(data.frame(city=c('广州','广州','佛山','佛山'), zone=c('天河','海珠','顺达','禅城'), pay = c(563,235)), index = c('city','zone'), vSize='pay', vColor='pay', type='comp', palette = rev(viridis(9)), draw = F))
from highcharter.
@jbkunst @shrektan i think it is not the same issue, the error i met is not like Error in gsub("</", "\\u003c/", payload, fixed = TRUE) :
> devtools::session_info()
Session info -------------------------------------------------------------------------------------------------------
setting value
version R version 3.2.3 (2015-12-10)
system x86_64, linux-gnu
ui RStudio (0.99.892)
language (EN)
collate en_US.UTF-8
tz <NA>
date 2016-05-23
from highcharter.
Hi @Funnng
The issue is because internally the hc_add_series_treemap
function is using a helper function str_to_id
which try to remove spectial character to put the name of the value as id
in the data series (check str_to_id("广州")
).
By now, you can use a modify hc_add_series_treemap2
(see code below) until I check if there no problem if I remove some replacement in the str_to_id
function.
library(dplyr)
library(purrr)
hc_add_series_treemap2 <- function(hc, tm, ...) {
df <- tm$tm %>%
tbl_df() %>%
select_("-x0", "-y0", "-w", "-h", "-stdErr", "-vColorValue") %>%
rename_("value" = "vSize", "valuecolor" = "vColor") %>%
purrr::map_if(is.factor, as.character) %>%
data.frame(stringsAsFactors = FALSE) %>%
tbl_df()
ndepth <- which(names(df) == "value") - 1
ds <- map_df(seq(ndepth), function(lvl){ # lvl <- sample(seq(ndepth), size = 1)
df2 <- df %>%
filter_(sprintf("level == %s", lvl)) %>%
rename_("name" = names(df)[lvl]) %>%
mutate_("id" = "name")
if (lvl > 1) {
df2 <- df2 %>%
mutate_("parent" = names(df)[lvl - 1],
"parent" = "parent")
} else {
df2 <- df2 %>%
mutate_("parent" = NA)
}
df2
})
ds <- list.parse3(ds)
ds <- map(ds, function(x){
if (is.na(x$parent))
x$parent <- NULL
x
})
hc %>% hc_add_series(data = ds, type = "treemap", ...)
}
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.