有没有人试过在 Power BI 的 R Script Visual 中使用Plotly
或Highchart
当我在 R 脚本编辑器中尝试此操作并运行时:
library(ggplot2)
library(plotly)
x <- 1:5
y <- c(1, 3, 2, 3, 1)
plot_ly(x = dataset$period, y = dataset$mean, name = "spline", line = list(shape = "spline"))
Run Code Online (Sandbox Code Playgroud)
错误信息:
没有创建图像。R 代码不会导致创建任何视觉效果。确保您的 R 脚本生成 R 默认设备的绘图。
但在我的 R 桌面上运行完美。任何想法?
我正在使用Plotly离线在python中生成图形.
根据以下文档,
https://plot.ly/python/offline/
这是我的代码,完美地生成C:/tmp/test_plot.html文件.
import plotly.offline as offline
offline.init_notebook_mode()
offline.plot({'data': [{'y': [4, 2, 3, 4]}],
'layout': {'title': 'Test Plot',
'font': dict(family='Comic Sans MS', size=16)}},
auto_open=False, filename='C:/tmp/test_plot')
Run Code Online (Sandbox Code Playgroud)
如何将此图保存为png而不是html?
当我使用公式创建一个新度量,即sum(col1)/ max(col2)时,它会自动将结果转换为#.#%格式.奇怪的是,它不会一直发生; 有时它只是给出结果#.##格式.
想知道如何格式化新措施(而不是列)作为百分比处理?
我尝试在PowerBI中将DAX组功能用作度量,新列,新表,但是在验证该功能时出现错误,
New Table = GROUPBY(
'tab1',
'tab1'[color],
"Group By color",
sum('tab1'[count_lables])
)
Error : Function 'GROUPBY' scalar expressions have to be Aggregation functions over CurrentGroup(). The expression of each Aggregation has to be either a constant or directly reference the columns in CurrentGroup().
Run Code Online (Sandbox Code Playgroud)