• Recent
    • Tags
    • Popular
    • Register
    • Login

    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 Mango 5 Documentation Website

    How to change date format on chart?

    Mango Automation general Discussion
    4
    8
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      timkk880
      last edited by

      How to change date format on chart x axis? I want to change "22 May" to "May 22" etc, is that possible?

      Jared WiltshireJ 1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by MattFox

        /ui/docs/ng-mango/ma-serial-chart
        

        Read the docs under API Docs -> components -> maSerialChart

        there's an attribute you can set to alter the format:

        time-format
        (optional)
        string	
        The moment.js time format to be used in displaying timestamps on the X axis.
        

        Put your moment.js format in there and that will let you set the format to 'DD mm' etc

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 1
        • phildunlapP
          phildunlap
          last edited by

          Thanks Fox!

          Just to ensure for timkk880, when he says,

          moment format

          he means Moment.js format

          1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ
            Jared Wiltshire @timkk880
            last edited by

            @timkk880 FYI by default it uses locale aware formatting. You can try changing the system wide locale (under system settings, language settings), or just change your user's locale.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • MattFoxM
              MattFox
              last edited by

              @phildunlap thanks Phil, I'll be sure to keep that in mind. Thank you both for your help

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              1 Reply Last reply Reply Quote 0
              • T
                timkk880
                last edited by

                Thank you MattFox, phildunlap and Jared Wiltshire,
                I searched the folder, and only found momentFilter.js, moment-timezone-with-data.js, moment-with-locales.js, moment-timezone-with-data.min.js, moment-with-locales.min.js, which one I should modify? Is that mean to replace "string" to "YYYY/MM/DD"?

                1 Reply Last reply Reply Quote 0
                • MattFoxM
                  MattFox
                  last edited by

                  I think I may have confused you a bit...

                  When you use the dashboard designer, one of the options for the maSerialChart is time-format.
                  so:

                  <ma-serial-chart points="chartPoints" values="chartPointValues" time-format="DD mm"></ma-serial-chart>
                  

                  I trust that is more along the lines of what you are trying to accomplish. Refer to the moment.js website for their docs if you are looking to format the time value in a specific manner.

                  Do not follow where the path may lead; go instead where there is no path.
                  And leave a trail - Muriel Strode

                  1 Reply Last reply Reply Quote 0
                  • T
                    timkk880
                    last edited by

                    Thank you MattFox, I get it!

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post