• 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

    Problem with Pie Chart

    Dashboard Designer & Custom AngularJS Pages
    4
    17
    4.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.
    • MattFoxM
      MattFox
      last edited by

      So you're telling me the data comes in as comma separated values???
      Could you please output the individual points data line by line so I can see how it sits within your markup?

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

      L 1 Reply Last reply Reply Quote 0
      • L
        leoboeng @MattFox
        last edited by leoboeng

        @mattfox said in Problem with Pie Chart:

        So you're telling me the data comes in as comma separated values???
        Could you please output the individual points data line by line so I can see how it sits within your markup?

        I have no more in front of the server for this, and even apologize for my English, I'm from Brazil and here the separation is made by commas (,), in the case of you points (.).

        The values ​​come in the following format, for example:

        Electric_current_Phase_A:

        5.0490
        5.9382
        4.0983

        In my formatting by Mango, it shows as follows:

        Electric_current_Phase_A:

        5.04 A
        5.93 A
        4.09 A

        That is why I say that the need for units is important to me, in the case of exemple the Amper (A), and this is what has been complicating my Pie Chart.

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

          So first off, the units come in looking like 5,0490 5,9382 4,0983 the comma for each measurement's decimal place and a space to separate each house. And this is for each datapoint

          Secondly, you only want the units to be 3 significant figures long, without rounding.

          Thirdly, you want to be able to use the Unit on the pie chart.
          I'm I hitting the nail on the head?

          if so, this is how I'd do it and just add the unit to the text.

          A_AtivoDiario_P.renderedValue.split(' ')[0]), text: 'Fase A (A)'
          

          if it's because it's a string you may have to use parseFloat( A_AtivoDiario_P.renderedValue.split(' ')[0]) )

          With some of this stuff here I sometimes think you over complicate things too much. If what is currently available in mango allows multiple axes gauge charts, that can do the same thing and you can label it as required...
          https://www.amcharts.com/kbase/animating-angular-gauge-bands/

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

          L 2 Replies Last reply Reply Quote 0
          • L
            leoboeng @MattFox
            last edited by

            @mattfox said in Problem with Pie Chart:

            So first off, the units come in looking like 5,0490 5.9382 4,0983 the comma for each measurement's decimal place and a space to separate each house.
            Secondly, you only want the units to be 3 significant figures long, without rounding.
            Thirdly, you want to be able to use the Unit on the pie chart.
            I'm I hitting the nail on the head?

            Yes that's right.

            The formatting with 3 significant units but I already got it.

            In the pie chart without the Units of Measurements it is possible to make a "point.renderedValue", but when units are added the pie chart does not work.

            So I used the "Slice", as I was shown, it worked about 2-3 days and today started to present that problem.

            1 Reply Last reply Reply Quote 0
            • L
              leoboeng @MattFox
              last edited by

              @mattfox said in Problem with Pie Chart:

              if so, this is how I'd do it and just add the unit to the text

              But doing so I would have to take the unit out of the point configuration, correct?

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

                Don't see how its different from using splice, it's still visible in the text label

                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
                • L
                  leoboeng
                  last edited by

                  I tried the following ways and even then continued showing a pie chart in "white"

                  <ma-get-point-value point-xid="DP_530359" point="P_Ativa_A"></ma-get-point-value>    
                    
                  <ma-pie-chart id="63759ca9-e465-45e3-80b8-89cda82627fe" style="height: 303px; width: 612px; position: absolute; left: 0px; top: 30px;" values="[{ value: parseFloat( P_Ativa_A.renderedValue.split(' ')[0]), text: 'Fase B', color: 'black' },]" options="{depth3D:15,angle:30}"></ma-pie-chart>
                  
                  <ma-get-point-value point-xid="DP_530359" point="P_Ativa_A"></ma-get-point-value>    
                    
                  <ma-pie-chart id="63759ca9-e465-45e3-80b8-89cda82627fe" style="height: 303px; width: 612px; position: absolute; left: 0px; top: 30px;" values="[{ value: P_Ativa_A.renderedValue.split(' ')[0], text: 'Fase A (A)', color: 'black' },]" options="{depth3D:15,angle:30}"></ma-pie-chart>
                  

                  All two codes showed the graphic in "white":

                  0_1533298722240_33.PNG

                  My points are configured as follows:

                  0_1533299292083_22.PNG

                  0_1533299271268_111.PNG

                  0_1533299278554_12.PNG

                  It pulls the data as follows:

                  0_1533299315981_12323.PNG

                  1 Reply Last reply Reply Quote 0
                  • CraigWebC
                    CraigWeb
                    last edited by

                    If your .value has to many decimals use toFixed() to reduce it.

                    values="[ { value: myPoint.value.toFixed(2), text: 'Consumo na Ponta (kW)', color: 'red' }
                    

                    Trying to get the unit on the value seems to be giving more problems than it is worth. Is it not enough to put the unit in the text?

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      leoboeng @CraigWeb
                      last edited by

                      @craigweb said in Problem with Pie Chart:

                      Trying to get the unit on the value seems to be giving more problems than it is worth. Is it not enough to put the unit in the text?

                      Hello,

                      Yes, but the problem I was facing is that even the decimal place I was able to put rendered, ie the value of the point came with 4 decimal places and just wanted to show 2, but your formula that passed me has already served and worked.

                      It would be nice to have the unit follow up but I'll text it.

                      Ah, thanks for the help.

                      1 Reply Last reply Reply Quote 0
                      • CraigWebC
                        CraigWeb
                        last edited by

                        Try this for your text

                        text: 'Phase A ' + myPoint.unit,
                        
                        MattFoxM 1 Reply Last reply Reply Quote 0
                        • MattFoxM
                          MattFox @CraigWeb
                          last edited by

                          @craigweb that's what I've been trying to get him to do all along. I was going to suggest using toFixed or even parseFloat but he wanted significant figures without rounding.

                          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
                          • First post
                            Last post