Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I made custom visuals with R script.
But I can not display japanese. japanese language was garbled.
I realize that the characters were convert from Latin-1 to UTF-8.
How can I resolve it?
・InputData
・Rscript
source('./r_files/flatten_HTML.r') ############### Library Declarations ############### targetPackages <- c('plotly','dplyr') newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])] if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org") libraryRequireInstall("plotly"); libraryRequireInstall("dplyr"); #################################################### ############ User Parameters ######### # Set of parameters from GUI MaxAlartLine = 200 if(exists("alartSetting_MaxAlartLine")){ MaxAlartLine = alartSetting_MaxAlartLine } MinAlartLine = 200 if(exists("alartSetting_MinAlartLine")){ MinAlartLine = alartSetting_MinAlartLine } MaxWarningLine = 100 if(exists("alartSetting_MaxWarningLine")){ MaxWarningLine = alartSetting_MaxWarningLine } MinWarningLine = -100 if(exists("alartSetting_MinWarningLine")){ MinWarningLine = alartSetting_MinWarningLine } AlartColor = '#0010c9' if(exists("alartSetting_AlartColor")){ AlartColor = alartSetting_AlartColor } WarningColor = '#0010c9' if(exists("alartSetting_WarningColor")){ WarningColor = alartSetting_WarningColor } ColorOn = TRUE if(exists("alartSetting_ColorOn")){ ColorOn = alartSetting_ColorOn } #################################################### ################### Actual code #################### #HeaderSetting headerValues <- list(); for (i in (0:ncol(Values))) { tmpname <- names(Values)[i] headerValues[i] <- tmpname } headerValues <- append(headerValues, "<b>Items</b>", after = 0) #count MaxAlartCountdata <- Values %>% dplyr::filter(Values[1] >= MaxAlartLine) %>% dplyr::summarise(cnt=n()) MaxWarningCountdata <- Values %>% dplyr::filter(Values[1] >= MaxWarningLine) %>% dplyr::summarise(cnt=n()) MinWarningCountdata <- Values %>% dplyr::filter(Values[1] <= MinWarningLine) %>% dplyr::summarise(cnt=n()) MinAlartCountdata <- Values %>% dplyr::filter(Values[1] <= MinAlartLine) %>% dplyr::summarise(cnt=n()) #CellSetting cellValues <- list( c('TotalCount','MaxAlartCount','MaxWarningCount','MinWarningCount','MinAlartCount'), c(nrow(Values),MaxAlartCountdata[1,1],MaxWarningCountdata[1,1],MinWarningCountdata[1,1],MinAlartCountdata[1,1])) #CellColorSetting colorvec <- c('white') if (ColorOn == TRUE){ if (MaxAlartCountdata[1,1] == 0) colorvec <- c(colorvec, 'white') else colorvec <- c(colorvec, AlartColor) if (MaxWarningCountdata[1,1] == 0) colorvec <- c(colorvec, 'white') else colorvec <- c(colorvec, WarningColor) if (MinWarningCountdata[1,1] == 0) colorvec <- c(colorvec, 'white') else colorvec <- c(colorvec, WarningColor) if (MinAlartCountdata[1,1] == 0) colorvec <- c(colorvec, 'white') else colorvec <- c(colorvec, AlartColor) } #Plot p <- plot_ly( type = 'table', header = list( values = headerValues, align = rep('center', ncol(Values) + 1), line = list(width = 1, color = 'black'), fill = list(color = 'white'), font = list(family = "Arial", size = 14, color = "black") ), cells = list( values = c(cellValues), align = rep('center', ncol(Values) + 1), line = list(color = "black", width = 1), fill = list(color = c('white',list(colorvec))), font = list(family = "Arial", size = 12, color = c("black")) )); #output internalSaveWidget(p, 'out.html'); ####################################################
・Result
We suggest to email pbircvsupport@microsoft.com
This email is supported by R expert.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I tried to email.
But No reply.
Please help me.
Our R-script developer is on vacation. He will reply soon.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
We investigated this issue. It seems you just need to add powerbi_rEnableShowTextForCJKLanguages = 1 at the beginning of your R-script.
To find out more please visit documentation: https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals#known-limitations
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
User | Count |
---|---|
5 | |
4 | |
4 | |
2 | |
2 |
User | Count |
---|---|
8 | |
4 | |
4 | |
4 | |
3 |