|
|
|
It is currently Thu May 23, 2013 3:52 pm
|
View unanswered posts | View active topics | View unsolved topics
|
Page 1 of 1
|
[ 7 posts ] |
|
Pie Chart label formatting
| Author |
Message |
|
miketob
Lieutenant
Joined: Mon May 03, 2010 10:08 am Posts: 61
|
 Pie Chart label formatting
Hello, I have a doubt with the formatting of labels in a pie chart: The data for the pie chart has two columns: EventName and Duration where Duration is in seconds. Is there a way to format the label to display the duration like "hh:mm:ss"? I tried to write an expression binding for the "labelFormat" property, but without success Thank you
_________________ Miguel A. Torres Orozco B.
|
| Mon May 14, 2012 2:08 pm |
|
 |
|
Travis.Cox
Moderator
Joined: Sun Apr 02, 2006 2:46 pm Posts: 1975 Location: Sacramento, CA
|
 Re: Pie Chart label formatting
You have to format it in the binding. For example, if the data is bound to a SQL query you can do something like: Code: SELECT DATE_FORMAT(t_stamp, '%h:%i:%s'), duration FROM table That function above exists in MySQL so it might be different depending on your database.
_________________ Travis Cox
Inductive Automation
Technical Support Rep.
|
| Mon May 14, 2012 2:57 pm |
|
 |
|
miketob
Lieutenant
Joined: Mon May 03, 2010 10:08 am Posts: 61
|
 Re: Pie Chart label formatting
Thank you Travis,
Yes, I thought about that, but the problem is that Duration is precisely the quantity that is being graphed, and I might have troubles if I cast it into a string, isn't it?
_________________ Miguel A. Torres Orozco B.
|
| Mon May 14, 2012 3:03 pm |
|
 |
|
Travis.Cox
Moderator
Joined: Sun Apr 02, 2006 2:46 pm Posts: 1975 Location: Sacramento, CA
|
 Re: Pie Chart label formatting
No, you just want to alter the first column which is the name of each wedge. Leave the duration column alone. It will be a numeric value.
_________________ Travis Cox
Inductive Automation
Technical Support Rep.
|
| Mon May 14, 2012 4:33 pm |
|
 |
|
miketob
Lieutenant
Joined: Mon May 03, 2010 10:08 am Posts: 61
|
 Re: Pie Chart label formatting
Mmmh, yes, it can work but I'd loose the Event Name, perhaps I can concatenate the Event Name and the formatted duration.
I think it would be great that the labelFormat property could accept formatting codes, something like: "{1:d}" or "{1:format('hh:mm:ss')}" or "{1:#,##0}" or something like that.
_________________ Miguel A. Torres Orozco B.
|
| Tue May 15, 2012 8:00 am |
|
 |
|
Travis.Cox
Moderator
Joined: Sun Apr 02, 2006 2:46 pm Posts: 1975 Location: Sacramento, CA
|
 Re: Pie Chart label formatting
I see. You would have to concatenate the two values since there is a single display for each wedge.
_________________ Travis Cox
Inductive Automation
Technical Support Rep.
|
| Tue May 15, 2012 9:33 am |
|
 |
|
miketob
Lieutenant
Joined: Mon May 03, 2010 10:08 am Posts: 61
|
 Re: Pie Chart label formatting
Thank you very much Travis
_________________ Miguel A. Torres Orozco B.
|
| Tue May 15, 2012 9:48 am |
|
 |
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: tsmith and 3 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|