@Dario Cairoli - Thanks for the question and using MS Q&A platform.
You can create plotly visual using the python() plugin, see Customize Azure Data Explorer dashboard visuals | Microsoft Learn.
To render a Plotly visual, the query must generate a table with a single string cell containing Plotly JSON. This Plotly JSON string can be generated by one of the following methods:
- Dynamically create the string in Python using the Plotly package. This process uses the python() plugin.
- Retrieve the string from a table that stores pre-cooked Plotly JSON templates. Update the required data fields using KQL string manipulation functions.
The following KQL query uses inline Python to create the 3D scatter chart:
OccupancyDetection
| project Temperature, Humidity, CO2, Occupancy
| where rand() < 0.1
| evaluate python(typeof(plotly:string),
```if 1:
import plotly.express as px
fig = px.scatter_3d(df, x='Temperature', y='Humidity', z='CO2', color='Occupancy')
fig.update_layout(title=dict(text="Occupancy detection, plotly 5.11.0"))
plotly_obj = fig.to_json()
result = pd.DataFrame(data = [plotly_obj], columns = ["plotly"])
```)
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.