# 2 questions on ui\_chart (bar chart)

**URL:** https://discourse.nodered.org/t/2-questions-on-ui-chart-bar-chart/57564
**Category:** Dashboard
**Tags:** chart
**Created:** [31 January 2022 18:31 UTC](https://discourse.nodered.org/t/2-questions-on-ui-chart-bar-chart/57564 "2022-01-31T18:31:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rakgupta](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rakgupta/32/42535_2.png) [@rakgupta](https://discourse.nodered.org/u/rakgupta)
#### Post date: [31 January 2022 18:31 UTC](https://discourse.nodered.org/t/2-questions-on-ui-chart-bar-chart/57564/1 "2022-01-31T18:31:15Z")

</div>

1. Is there a way to show labels on the bars? I've searched the forum and haven't found an answer. There is a plug-in for chartjs (datalables) but haven't found anything on how to get it working with ui\_chart.

2. Is there a way to add a border to a stacked bar chart? I have tried the following but it seems to have no effect

```auto
elements: {
            bar:{
            borderWidth:10,
            borderColor: "white"
            }
        },

```

All the other options (scales, legends, plugin-\>title) seem to work. Thanks for your help.

**UPDATE:**  
I figured a work around for the border color issue and am now setting the barThickness based on the number of datapoints. I was setting the bar thickness to a fixed width to avoid the chart displaying really broad bars if the number of datapoints were few. I set it to "0" if the datapoints are greater than X and a fixed width if below X and that results in the chart node automatically calculating the optimal width.

On the data labels - the only way I could figure this out is showing the data points in a table.

 ![Screen Shot 2022-01-31 at 5.06.03 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/076a482d2d175b458a96950154a3f701d2f1d797.png)

Does anyone have other suggestions? Thanks..

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 March 2022 18:32 UTC](https://discourse.nodered.org/t/2-questions-on-ui-chart-bar-chart/57564/2 "2022-03-02T18:32:04Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
