# Pie chart slice style and events

**URL:** <https://forum.inductiveautomation.com/t/pie-chart-slice-style-and-events/70000>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 17, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/pie-chart-slice-style-and-events/70000 "2023-02-17T14:36:54Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [March 23, 2023, 7:42pm UTC](https://forum.inductiveautomation.com/t/pie-chart-slice-style-and-events/70000/6 "2023-03-23T19:42:22Z")

</div>

I can work around it with setting the pie chart legend to bottom position, using a left join in the query to make sure my number of rows is constant, and setting the size of the container.

It doesn't solve the above questions though.

* * *

My newest concern is that I have set a binding for showing values or percentages and I am using a parameter to switch between events and time in the data query.

Well when I show the time, it shows in seconds.  
**Is there a good way to convert the format of the legend values to hh:mm:ss while still having the pie look normal?**  
I don't know how to keep it as a number for the pie and then format the legend also.

`{category} : {value.percent.formatNumber('#.0')}%`  
I think I can bind toolTipFormat to convert the tool tip, but I don't see anything for the legend values.

Is there a way to do to math in the tooltip?

I thought I might be able to combine:  
[Expression tag to convert minutes to hh:mm:ss - #2 by KathyApplebaum](https://forum.inductiveautomation.com/t/expression-tag-to-convert-minutes-to-hh-mm-ss/9154/2)]  
and  
[Tooltips – amCharts 4 Documentation](https://www.amcharts.com/docs/v4/concepts/tooltips/)]  
Some kind of amcharts math if it is possible.

* * *

Well I kind of did an expression binding, but it isn't right as # and % are not allowed.

```auto
if( {...../flexFilter/flexDate_1/Dropdown.props.value}=1
,'{category} : {value.percent.formatNumber(\'00.0\')} percent\nEvents:{value}',
'{category} : {value.percent.formatNumber(\'00.0\')} percent\nSeconds:{value}\nDowntime:{value.formatDuration(\'hh:mm:ss\')}')

```

Still shows 100% correctly even when `.formatNumber(\'00.0\')`

```auto
SELECT keyName, val
FROM (select 35 as performance, 65 as ad) t
UNPIVOT( val for keyName in (performance, ad)) u

```

Also, copied this from @JordanCClark and wanted to post here so I could find it again easier to test my pie chart.

* * *

```auto

Select coalesce(S.AutoLogged,0) as AutoLogged
, coalesce(S.Entered,0) as Entered
, convert(varchar,dateadd(hh,-7, GETDATE()), 20) as Since from(
  SELECT 0 AS test
) AS dummy
LEFT JOIN (
select....
from...
left join anotherTable on....
where...
group....
) as S
 ON 1= 1

```

I needed this trick/technique too.

---

_[View the full topic](https://forum.inductiveautomation.com/t/pie-chart-slice-style-and-events/70000)._
