# Bar chart ticks labels format

**URL:** <https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 30, 2017, 10:05am UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809 "2017-10-30T10:05:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [October 30, 2017, 10:05am UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809/1 "2017-10-30T10:05:34Z")

</div>

I’m using a **Bar Chart** object to show some values, where the categories are **DateTime** values. I cannot find a way to format the **Category Axis** labels as `yyyy-MM-dd` instead of what you can see in the following screenshot:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/06b5956086ab2800f3684201ca91a66da516017c.png)

Thanks in advance, regards

---

<div class="post-metadata">

**Author:** ![snngeru](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@snngeru](https://forum.inductiveautomation.com/u/snngeru)\
**Post date:** [October 30, 2017, 5:21pm UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809/2 "2017-10-30T17:21:46Z")

</div>

You can try to format those DateTime values as strings before bringing them into the Bar Charts Dataset.

I don’t believe that the bar chart component uses JFreeCharts DateAxis Class for it’s Domain Axis and uses the CategoryAxis Class. If that is the case then you won’t be able to format the DateTime values that you see in the Category Axis easily.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [October 30, 2017, 7:11pm UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809/3 "2017-10-30T19:11:26Z")

</div>

Thanks snngeru, I was just thinking the same, however I tried to see if there was a way through standard chart properties.

---

<div class="post-metadata">

**Author:** ![samngeru](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/samngeru/32/6007_2.png) [@samngeru](https://forum.inductiveautomation.com/u/samngeru)\
**Post date:** [October 30, 2017, 7:36pm UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809/4 "2017-10-30T19:36:47Z")

</div>

You can possibly do this on the configureChart extension function for the standard chart component

```auto
from java.text import SimpleDateFormat	
dateFormat = SimpleDateFormat("yyyy-MM-dd")
chart.getPlot().getDomainAxis().setDateFormatOverride(dateFormat)

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 30, 2017, 8:37pm UTC](https://forum.inductiveautomation.com/t/bar-chart-ticks-labels-format/15809/5 "2017-10-30T20:37:39Z")

</div>

Yeah, this will work great, but the Bar Chart is just calling `toString` if the first column isn’t already a string, so the best answer (using the bar chart component) is what @snngeru first suggested with formatting the column in the query/script.
