When I save from notebook to insights, the diagram does not show up on the insights screen.
Hi, community.
I would like to save the static insights and add them to the dashboard.
However, when I run the following command to save it to an insight, it does not show up when I go to the Insights screen.
Can someone please help me with this?
Below is the python code.
---------
import dataiku
from dataiku import pandasutils as pdu
from dataiku import insights
import pandas as pd
import datetime
import plotly.express as px
mydataset = dataiku.Dataset("Result_data_prepared")
df = mydataset.get_dataframe()
df_colors = df.drop_duplicates(['商品カテゴリ'])['商品カテゴリ']
colors = ['#5799c7','ff9f4a', '#61b861']
colors_dict = dict(zip(df_colors, colors))
df_prepared = df.groupby(by=["商品カテゴリ", "商品"]).count()[["salesTotal"]]
df_prepared = df_prepared.reset_index()
fig = px.sunburst(df,
path=["商品カテゴリ", "商品"],
color='商品カテゴリ',
values='salesTotal',
color_discrete_map=colors_dict)
fig.show()
insights.save_plotly("my-plotly-plot", fig)
Doc:
https://knowledge.dataiku.com/latest/data-viz/static-insights/tutorial-static-insights.html
Operating system used: design node
Operating system used: design node
Operating system used: design node
Answers
-
Don't know if it's related, but during the instruction about Insights of the Developer-training I found out that opening the insight that is saved right from the Python script within the local 13.1 version is giving an error, but copying that insight to another name gives an insight that can be viewed and shared. So I guess somewhere in the project references to those insights a difference might be found.
-
There is a difference, the Insight that is saved from the instruction shows up in the insights screen, however it can't be opened.