1. Sivaprakash BKR
  2. PowerBuilder
  3. Thursday, 20 June 2024 06:05 AM UTC

Hello

Using PB 2022 R3 3356

Need to display a value [medical report] in graphical presentation like this

Actual value is 26.1 and that to be marked with an arrow [ as shown in the picture] and need to color range to indicator whether it's safe or danger.  The value will vary for every person.

Can it be created in PB, by giving the ranges for color and the result to mark the arrow?  Or any other third-party tools available [E-charts or Google Charts like that] ?  

Any idea how this could be done.

Happiness Alway
BKR Sivaprakash

 

John Fauss Accepted Answer Pending Moderation
  1. Friday, 21 June 2024 02:57 AM UTC
  2. PowerBuilder
  3. # 1

Here's an example/prototype of a DataWindow that displays the "segmented bar graph":

As the text in the DW explains, the "graph" is constructed with a handful of DWObjects. The "pointer" (down arrow) is a computed field with the expression CharA(136) using the Webdings3 font sized to 20 points.

The X-position of the pointer could also be set based on a column's value, although that has not been done for this prototype.

All of the graph's DWObjects can be dynamically created at execution time by constructing the syntax for each DWObject and issuing a Create statement via the DW's Modify function... The syntax to produce the needed number of segments, position, length, and color for each segment could be generated in PowerScript. The same for the text/legend labels and the pointer computed field. This task be a little tedious, but it's not difficult.

I'm attaching a zip file that contains this PB 2019 sample application so that you can examine the DataWindow in detail at your convenience.

Best regards, John

Attachments (1)
Comment
  1. Sivaprakash BKR
  2. Friday, 21 June 2024 05:36 AM UTC
Thanks John, that gave me an idea how to proceed further. I'll try constructing the required DW's using modify function. Finally, I may need to insert that into a Rich Text edit field. Can this result be converted to an image file? DW to image (jpg, jpeg, png etc )?
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 21 June 2024 06:14 AM UTC
Very nice John.
  1. Helpful
  1. René Ullrich
  2. Monday, 24 June 2024 05:53 AM UTC
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 20 June 2024 14:23 PM UTC
  2. PowerBuilder
  3. # 2

How general-purpose does this functionality have to be? In other words, is the example you provided the ONLY one that will be needed or will there be a need to produce variations? If variations will be needed, what properties of this graph can vary?

Does this graph need to be contained within a report? Viewed only? Printed?

The most critical question I have for you is: How much effort are you willing and able to invest in creating a solution?

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 20 June 2024 12:00 PM UTC
  2. PowerBuilder
  3. # 3

Hi BKR;

  I would build this as either a custom visual user object or using a custom DWO. For the DWO, I'm thinking maybe a Grid style with each column a different colour. Then change the with if each column to represent the % you need to display.  Food for thought 

HTH 

Regards ... Chris 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.