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

  • The code was working perfectly but it stopped working.

    <div class="ma-designer-root" id="69cb3d48-9218-481c-98fd-32a687ea174e" style="width: 1366px; height: 768px; position: relative;">
        <ma-get-point-value point-xid="DP_530359" point="P_Ativa_A"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_807622" point="P_Ativa_B"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_515819" point="P_Ativa_C"></ma-get-point-value>
        <ma-pie-chart id="63759ca9-e465-45e3-80b8-89cda82627fe" style="height: 303px; width: 612px; position: absolute; left: 0px; top: 40px;" values="[ { value: P_Ativa_A.renderedValue.slice(0, P_Ativa_A.renderedValue.indexOf(' ')), text: 'Fase A', color: 'red' }, { value: P_Ativa_B.renderedValue.slice(0, P_Ativa_B.renderedValue.indexOf(' ')), text: 'Fase B', color: 'black' }, { value: P_Ativa_C.renderedValue.slice(0, P_Ativa_B.renderedValue.indexOf(' ')), text: 'Fase C', color: 'white' } ]" options="{depth3D:15,angle:30,legend:{'position':rigth,marginRight:100,autoMargins:false}}"></ma-pie-chart>
        <div id="6da01089-3a57-4adc-820d-c7b16e317f4d" style="position: absolute; left: 248px; top: 14px;">Demanda (kW)</div>
        <ma-point-value id="6da01089-3a57-4adc-820d-c7b16e31734e" style="position: absolute; width: 95.9688px; height: 18px; left: 457px; top: 319px; text-align: center; line-height: normal; font-size: 12px;" point-xid="DP_892466"></ma-point-value>
        <div id="9a443ad1-7ffa-4ea9-b6cf-81afbd5ba0a5" style="position: absolute; left: 409px; top: 317px; font-size: 14px;">Total:</div>
        
        <ma-get-point-value point-xid="DP_147675" point="P_Reativa_A"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_495992" point="P_Reativa_B"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_170532" point="P_Reativa_C"></ma-get-point-value>
        <ma-pie-chart id="51518ce5-4bbd-436c-b152-33b9cab8b661" style="height: 303px; width: 612px; position: absolute; left: 612px; top: 40px;" values="[ { value: P_Reativa_A.renderedValue.slice(0, P_Reativa_A.renderedValue.indexOf(' ')), text: 'Fase A', color: 'red' }, { value: P_Reativa_B.renderedValue.slice(0, P_Reativa_B.renderedValue.indexOf(' ')), text: 'Fase B', color: 'black' }, { value: P_Reativa_C.renderedValue.slice(0, P_Reativa_C.renderedValue.indexOf(' ')), text: 'Fase C', color: 'white' } ]" options="{depth3D:15,angle:30,legend:{'position':rigth,marginRight:100,autoMargins:false}}"></ma-pie-chart>
        <div id="5260430c-4141-4b8c-841c-a295939587e0" style="position: absolute; left: 839px; top: 15px;">Demanda Indutiva (kVAr)</div>
        <div id="8ec6afb5-9c47-4b3f-b2f4-15c313f36895" style="position: absolute; left: 1038px; top: 318px; font-size: 14px;">Total:</div>
        <ma-point-value id="a040eff7-b295-432b-8d1c-ce5e6df3aba3" style="position: absolute; width: 95.9688px; height: 18px; left: 1094px; top: 321px; text-align: center; line-height: normal; font-size: 12px;" point-xid="DP_138259"></ma-point-value>
        
        <ma-get-point-value point-xid="DP_954001" point="A_AtivoDiario_FP"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_940363" point="A_AtivoDiario_P"></ma-get-point-value>
        <ma-pie-chart id="878e8fce-42a5-4291-ab8c-db54f97af9e1" style="height: 420px; width: 641px; position: absolute; left: 0px; top: 342px;" values="[ { value: A_AtivoDiario_FP.renderedValue.slice(0, A_AtivoDiario_FP.renderedValue.indexOf(' ')), text: 'Consumo Fora de Ponta', color: 'red' }, { value: A_AtivoDiario_P.renderedValue.slice(0, A_AtivoDiario_P.renderedValue.indexOf(' ')), text: 'Consumo na Ponta', color: 'black' }]" options="{depth3D:15,angle:30,legend:{'position':rigth,marginRight:100,autoMargins:false}}"></ma-pie-chart>
        <div id="53397a10-40d3-497a-a11c-5f9f1c7a3fa9" style="position: absolute; left: 233px; top: 411px;">Consumo Ativo Diário (kWh)</div>
        <div id="e42746f5-2cc7-43fe-b715-515a85904545" style="position: absolute; left: 454px; top: 734px; font-size: 14px;">Total:</div>
        <ma-point-value id="997cb925-2c57-4d6f-9747-6bd18b41c2d0" style="position: absolute; width: 95.9688px; height: 18px; left: 517px; top: 735px; text-align: center; line-height: normal; font-size: 12px;" point-xid="DP_929069"></ma-point-value>
        
        <ma-get-point-value point-xid="DP_280526" point="A_AtivoMensal_FP"></ma-get-point-value>
        <ma-get-point-value point-xid="DP_738729" point="A_AtivoMensal_P"></ma-get-point-value>
        <ma-pie-chart id="1a248030-0ea5-4a94-a659-f60b1bdce677" style="height: 420px; width: 641px; position: absolute; left: 641px; top: 342px;" values="[ { value: A_AtivoMensal_FP.renderedValue.slice(0, A_AtivoMensal_FP.renderedValue.indexOf(' ')), text: 'Consumo Fora de Ponta', color: 'red' }, { value: A_AtivoMensal_P.renderedValue.slice(0, A_AtivoMensal_P.renderedValue.indexOf(' ')), text: 'Consumo na Ponta', color: 'black' }]" options="{depth3D:15,angle:30,legend:{'position':rigth,marginRight:100,autoMargins:false}}"></ma-pie-chart>
        <div id="fd952897-7ff7-49fd-86da-c31e75633f7f" style="position: absolute; left: 875px; top: 411px;">Consumo Ativo Mensal (kWh)</div>
        <div id="5cb80112-7e0a-47c6-a5d7-e6582422d2ab" style="position: absolute; left: 1098px; top: 734px; font-size: 14px; width: 30.9531px; height: 19px;">Total:</div>
        <ma-point-value id="54931f3a-3721-45c9-a618-c075ef353298" style="position: absolute; width: 95.9688px; height: 18px; left: 1157px; top: 736px; text-align: center; line-height: normal; font-size: 12px;" point-xid="DP_185150"></ma-point-value>
    </div>
    

    0_1533238820830_Capturar.PNG

    0_1533238834648_Capturar2.PNG

    Do you have any idea what the problem might be?


  • I suggest you also check the network tab and refresh the page.
    filter out point-value requests and check to see if you've got values coming through for a start. Once we have those, we can apply the changes you've inputted with those string based functions to ensure the pie charts are actually getting real numerical values...
    Not enough info here to work out what you've done/changed since the info that Phil gave you.


  • ^ This

    which could be aided by printing what the values you're passing to the pie chart directive is, like,

    {{ P_Reativa_A.renderedValue.slice(0, P_Reativa_A.renderedValue.indexOf(' ')) }}
    

    somewhere on the page.


  • I have already updated the page, restart the server, check the internet and everything ok. I did a chart pie only with the values ​​of the points "point.value" and showed everything correctly. I did not move in any configuration of the point, it was working correctly and the point is still being updated the values, just does not show the graph anymore. So much so that the "Total" is the sum of all the points that compose the char pie.

    I did not make any major changes to the code that was passed to me just added some items that are not part of the chart pie. On the chart pie I just added the caption.


  • @leoboeng said in Problem with Pie Chart:

    I did a chart pie only with the values ​​of the points "point.value" and showed everything correctly.

    Then why not just stick to using '.value' rather than using '.renderedValue' and making it more complicated than necessary?


  • @mattfox said in Problem with Pie Chart:

    Then why not just stick to using '.value' rather than using '.renderedValue' and making it more complicated than necessary?

    For it is about electrical measurements and the better visually go accompanied by their units. In addition, the meter pulls data with 4 houses after the comma, for example 5.0892, and I want to work with only 2 houses.

    In the matter of decimals it is quieter because the "point.renderedValue" only works with this type. It stops working when I add the Unit of measurement and this for me is very important because there are other graphs, and lists that work with it, so I can not take it. And it is not at all feasible for me to create 2 points just to make that point distinction with unit of measure and point without unity.


  • 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?


  • @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.


  • 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/


  • @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.


  • @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?


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


  • 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


  • 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?


  • @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.


  • Try this for your text

    text: 'Phase A ' + myPoint.unit,
    

  • @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.