Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.