# XY Chart Tooltip - Is possible to use the if condition in the expression?

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-tooltip-is-possible-to-use-the-if-condition-in-the-expression/96897>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 7, 2024, 12:30pm UTC](https://forum.inductiveautomation.com/t/xy-chart-tooltip-is-possible-to-use-the-if-condition-in-the-expression/96897 "2024-10-07T12:30:16Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [October 7, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/xy-chart-tooltip-is-possible-to-use-the-if-condition-in-the-expression/96897/11 "2024-10-07T15:57:04Z")

</div>

My [Embr-Charts](https://forum.inductiveautomation.com/t/musson-industrial-s-embr-charts-module/91618/45) module’s `Chart.js` component allows for totally custom tooltip content.

> **[Tooltip | Chart.js](https://www.chartjs.org/docs/latest/configuration/tooltip.html#tooltip-callbacks)**
>
> Open source HTML5 Charts for your website

You can create callbacks that modify a section of the tooltip (title, body, footer, labels, etc.), or you go fully custom and create the entire tooltip yourself using the “External HTML Tooltip” functionality.

The `contex` parameter passed into the callback functions allows you to access the current hovered point (+ the rest of the chart’s properties), so you can choose what information you put on the tooltip.

The `self` parameter available in the callback is the Perspective component itself, which allows you access things like custom properties from within the callbacks.

I will say that this is fairly advanced and if you aren’t comfortable with Javascript you’ll probably have a bad time.

---

_[View the full topic](https://forum.inductiveautomation.com/t/xy-chart-tooltip-is-possible-to-use-the-if-condition-in-the-expression/96897)._
