# Bar Chart and Button

**App View:** <br>

<figure><img src="/files/gEAWJ8UgUe2sbh8Hd9ai" alt=""><figcaption></figcaption></figure>

**Code:**&#x20;

```python
import streamlit as st
import xplain
#import plotly.express as px

x = xplain.Xsession()
x.startup('sDefault_withQCost_sample_5')
x.run({
    "method": "deleteRequest",
    "requestName": "test"
})

df = x.open_attribute(object_name="Product", 
    dimension_name="Automat", 
    attribute_name="Automat",
    request_name="test")
fig = st.bar_chart(df, x='Automat', y='# Product')
st.title="This is a minimal streamlit app powerd by Xplain Data"
#st.plotly_chart(fig)
if st.button('Say hello'):
    st.write('hello world!')
```

**Packages** that should be entered in the pip install field: `streamlit, xplain`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xplain-data.gitbook.io/community-edition/python-services-overview/app-building/streamlit-examples/bar-chart-and-button.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
