logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
j.torres@tewis.com  
#1 Posted : Thursday, August 8, 2019 8:54:28 AM(UTC)
j.torres@tewis.com

Rank: Member

Groups: Registered
Joined: 4/7/2019(UTC)
Posts: 23
Spain

Thanks: 6 times
Hello.
We're trying several ways to get a data element value with a specific unit measure but we don't success. Moreover, the result is different if we get the result in datable or chart.
For instance, I've a field that is the difference in hours between two datetime's. I want to view the number with two decimals (like D2) followed by "h".
Following .Net instructions, if I add something between simple or double quotes, this displayed value should concatenate it. But it doesn't work. Examples. The calculated value is 335,6167:

Format D2: In chart I get 335,62 (OK). In datable I get 335,6167 (No OK).
Format D2 "h": In chart I get 335,6167 (No OK). In datable I get D2 h (h without quotes, like if it recognized the concatenation but not the number. No OK)

Format 0.00: In chart I get 335,6167(No OK). In datatable I get 335,62 (OK).
Format 0.00 "h": In chart I get 335,6167(No OK). In datable I get 335,62 h (OK).

So, the only way to see the result OK is woth a datable and format 0.00. There is no way to get correctly the number with the chart (same results with the three supported chart libraries).

Thanks in advance
epf  
#2 Posted : Wednesday, August 14, 2019 2:24:34 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 733
Switzerland

Thanks: 14 times
Was thanked: 135 time(s) in 131 post(s)
Yes, custom format are limited for charts as the conversion tend to be automatic,
which is difficult from .Net format to go to the D3 format used by the charts.
this could be enhanced in a future release...


however it is easy to modify your chart template to have the format wanted,
e.g. for chart JS:
edit your chartJS view template and just modify the lines:

Line 89 for the ToolTip
Code:
                            else valStr = d3.format(",.2f")(val) + " \'Day\'";


Line 159 for the axis
Code:
                                        return d3.format(",.2f")(label) + " \'Day\'";



This correspond to the Custom .Net:
Code:
#,##0.00 "'Day'"


This is just a sample, you might change it if the axis is a date, etc.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.