Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Simple point components right aligned


  • Hi,

    Is there a way to be able to give the right top coordinates of a Simpe point component instead of the left top coordinates?
    I'm displaying some informations in a table, where the first column consists of static labels (on background image), and the current values are displayed in the second column. The values differ in length, this is why they should be right aligned (or centered, like on Watch list).

    Thanks,
    Greg


  • Hi Greg,

    This is a tricky thing, because to do this in a simple component would mean recalculating the size of the div at every update.

    An alternative is to get the browser to do it for you. The catch is that you need to determine the maximum size of the component ahead of time such that you can still position it using top/left. You'd use a script component with an inner div that has a text-align of right.

    
    return '<div style="text-align:right;width:100px;">'+ value +'</div>';
    
    

  • Hi,

    Thank you for the answer.

    But as I know, using a Server-side script, I can not use the different text renderers, that are used when displaying values with Simple point components. (rendering can be also coded inside the script, but it will be redundant)

    Regards,
    Greg


  • The variables "htmlText" and "renderedText" have been added to the script context.


  • Great, thank you!

    Regards,
    Greg