# Dash Mantine Component - Line Chart tooltip formatter

**URL:** <https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481>\
**Category:** 📊 Plotly Python\
**Created:** [February 9, 2025, 1:41pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481 "2025-02-09T13:41:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![waspp](https://avatars.discourse-cdn.com/v4/letter/w/3bc359/32.png) [@waspp](https://community.plotly.com/u/waspp)\
**Post date:** [February 9, 2025, 1:41pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/1 "2025-02-09T13:41:06Z")

</div>

Hi,

I am trying define some ‘formatter’ to be displayed on my dmc.LineChart component on the tooltip level (and also the y-axis) but I don’t seem to find any way to currently do so. The recharts documentation says that you can set a ‘formatter’ function on the tooltip component level but this doesn’t seem to be accessible from the dmc component in Dash.

This seems like a pretty basic functionality on graphs, am I missing something or is this just not doable at the moment?

See my screenshot attached that display one example of a tooltip in my LineChart that I would like to format to something like : “241,203.9”.

Thanks everyone for the help in advance!

A

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/1/f/1f50920931918f81e0657b10ee896597b6d87d57.png)

---

<div class="post-metadata">

**Author:** ![mayaradaher](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mayaradaher/32/28994_2.png) [@mayaradaher](https://community.plotly.com/u/mayaradaher)\
**Post date:** [February 9, 2025, 2:40pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/2 "2025-02-09T14:40:54Z")

</div>

Hi, @waspp.  
You can try this:

Example:  
df = pd.DataFrame(dict(  
test = [1000, 3500]  
))

fig = px.line(df, x=“test”, markers=True)  
fig.show()

 ![Captura de Tela 2025-02-09 às 11.38.43](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/1/8/18a64e7c8060c8fcf997f5609d4912b36fdbc94a.png)

> Replace **{x:,}** with the appropriate variable name (x, y, or z, etc.) to display its value.

fig.update\_traces(hovertemplate=“%{x:,}”)  
fig.show()

 ![Captura de Tela 2025-02-09 às 11.32.53](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/4/2/42f804c6f2ef115b417e3b3ed3ce562df60a3157.png)

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [February 9, 2025, 4:01pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/3 "2025-02-09T16:01:43Z")

</div>

Hi @waspp and welcome to the Dash community 🙂

Typically Dash does not allow functions to be passed in props. There are certain libraries which have enabled this like dash-ag-grid. It’s on the roadmap to add this feature to dash-mantine-components, but it is not available yet.

---

<div class="post-metadata">

**Author:** ![waspp](https://avatars.discourse-cdn.com/v4/letter/w/3bc359/32.png) [@waspp](https://community.plotly.com/u/waspp)\
**Post date:** [February 9, 2025, 6:08pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/4 "2025-02-09T18:08:33Z")

</div>

Thank you for you solution using plotlyexpress. I wanted to use dmc chart library as I think they are way cleaner but seems like what I want is not achievable at the moment.

---

<div class="post-metadata">

**Author:** ![waspp](https://avatars.discourse-cdn.com/v4/letter/w/3bc359/32.png) [@waspp](https://community.plotly.com/u/waspp)\
**Post date:** [February 9, 2025, 6:09pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/5 "2025-02-09T18:09:04Z")

</div>

Hey @AnnMarieW, understood, thanks for the explanations, really appreciate it!

---

<div class="post-metadata">

**Author:** ![mayaradaher](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mayaradaher/32/28994_2.png) [@mayaradaher](https://community.plotly.com/u/mayaradaher)\
**Post date:** [February 9, 2025, 6:55pm UTC](https://community.plotly.com/t/dash-mantine-component-line-chart-tooltip-formatter/90481/6 "2025-02-09T18:55:39Z")

</div>

> [@waspp](#):
>
> Thank you for you solution using plotlyexpress. I wanted to use dmc chart library as I think they are way cleaner but seems like what I want is not achievable at the moment.

I agree, dmc charts do look great. Hopefully they’ll add that feature in the future.
