Bar Charts Format Number Y Label & Tooltip

OS info

  • Operating System : Mac OSX 21.6.0
  • Wappler Version : 5.2.5

Problem description

Formatting value for Y label & tooltip but turns to be an error.

Steps to reproduce

Screen Shot 2022-11-26 at 23.41.13

<dmx-chart id="chartRevenueMonthly" class="chartjs-render-monitor light" width="320" height="200" point-size="" type="bar" dmx-bind:data="jsonRevenueData.data.revenue_monthly" dataset-1:tooltip="" dataset-1:label="Pendapatan" nogrid="true" thickness="1" colors="colors3" responsive="true" dataset-1:value="amount" labels="month"></dmx-chart>

Screen Shot 2022-11-26 at 23.39.19

<dmx-chart id="chartRevenueMonthly" class="chartjs-render-monitor light" width="320" height="200" point-size="" type="bar" dmx-bind:data="jsonRevenueData.data.revenue_monthly" dataset-1:tooltip="" dataset-1:label="Pendapatan" nogrid="true" thickness="1" colors="colors3" responsive="true" dataset-1:value="amount.formatNumber(2, '.', ',')" labels="month"></dmx-chart>

You should not use formatNumber on the value, it will convert the value to a string while the chart needs a number as value.

1 Like

Hi Patrick,

Thank you for the response. Found the solution by formatting label-y content. However, I can’t find the ‘$value’ inside the data binding selector. So I’m writing it manually in a code editor and it works. Is it bugs possible?

1 Like