对于Plotly Express,在创建图形时,需要使用 public class SceneApplicationService : ISceneApplicationService
{
private readonly DbConnection _connection;
public SceneApplicationService(DbConnection connection)
{
_connection = connection;
}
public async Task<IEnumerable<LegacySceneResponse>> GetByProgramScript(long programId,string scriptId)
{
object parameters = new
{
CodigoPrograma = programId,CodigoRoteiro = scriptId
};
if (!ObjectValidation.IsInvalidAnyNullOrEmpty(parameters)) ;
return await _connection.QueryAsync<LegacySceneResponse>(GetScenesByScriptAndProgram.Query,parameters);
}}
参数。例如:
custom_data
,然后使用fig = px.scatter(
data_frame=df,x='ColX',y='ColY',custom_data=['Col1','Col2','Col3']
)
和update_traces
对其进行修改,将其引用为hovertemplate
。例如:
customdata
由于没有充分的文档证明,因此花了很多试验和错误才能弄清,fig.update_traces(
hovertemplate="<br>".join([
"ColX: %{x}","ColY: %{y}","Col1: %{customdata[0]}","Col2: %{customdata[1]}","Col3: %{customdata[2]}",])
)
和custom_data
之间的不一致令人困惑。
,
您可以通过以下方式将自定义数据添加到hovertemplate中:
hovertemplate = 'Price: $%{customdata[0]:.2f}'+'<br>Week: %{customdata[1]} '
+ '<br>Change: %{customdata[2]}'
其中customdata
可以是您的group_dfff
或什至是您希望从中获取悬停信息数据的其他完全不同的数据框。
这是有关文档的link。
本文链接:https://www.f2er.com/3026449.html