Plotting graphs

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Hey Sven,

      I thank you for your reply, and also for the PID file. That is great!

      So, the codes work correctly as they are meant to : touch screen button works and so the graph. This will give a good starting point to rework on my project.

      Have a great day and with kind regards,

      Sue
    • Dear Sven,

      I have got one question while working on my project :
      #1. When I work with the array, how can I convert the type uint32_t to the type GUI_POINT ?
      I have been trying to resolve this issue, but fail so far.....

      I thank you in advance for your technical assistance and with my kind regards,

      Sue
    • Hi,

      there are two types of graph data. One is using points (the XY version) and the other one uses values (YT).

      Call GRAPH_DATA_XY_GetPoint() to get a point of the given index. If you added 3 points use an index of 1 to get the second point. The point values are getting stored where pPoint points to.

      If you want to get the data stored in a YT graph call GRAPH_DATA_YT_GetValue(). Although, this data object doesn't work with GUI_POINTs you can create your own:



      Source Code

      1. GUI_POINT Point;
      2. Point.x = 10;
      3. GRAPH_DATA_YT_GetValue(hData, &Point.y, Point.x);

      You can use the return value of GRAPH_DATA_YT_GetValue() to check if there is a value at the given index.


      Regards,

      Sven
    • Good morning Sven,

      I thank you very much for your quick and great reply : that helps me to move forward in my project.

      Further, I am going to implement this in my codes, and also to learn better the GUI chapter from your manual.
      Then, I will give you a feedback on how things work.....

      Have a nice day and with my kind regards,

      Sue
    • Good morning Sven,

      I managed to get your example code of WIDGET_GraphXY.c and learn from it about the GUI_POINT.
      This part interests me a lot :
      ...
      _aPoint[0].x = (int) (100 - r * cos(Rad));
      _aPoint[0][i].y = (int) (100 + r * sin(Rad) * Deg / 360);
      ....

      So, inspiring from the above codes, I have done something similar :
      ...
      _aI[i].x = (int) Axis_U_Array[i];
      _aI[i].y = (int) Axis_I_Array[i];
      ...

      However, I have experienced the following issue with those codes :
      #1. Putting the break point just after those codes, the Axis_U_Array[i] and Axis_I_Array[i] have got the correct values. However, the _aI[i].x and _aI[i].y registers have got null values.
      Do you know what is wrong with that operation ?
      #2. I have been trying to use the function GRAPH_DATA_XY_GetPoint() to put the measurement values (from an array) to GUI_POINT, but fail so far.
      May I ask you an example or a tip on how to do this ?

      I thank you in advance for your useful help and with my kind regards,

      Sue
    • Hey Sven,

      Learning from the WIDGET_GraphXY.c, I have managed to read and to display the measurement points. So, this is okay now.
      And I thank you for your technical support and help so far.

      Nowadays I have 2 questions regarding the graph display :
      #1. Plotting 2 graphs on the same display window, is it possible to have 2 different vertical Y axis sharing the same horizontal X axis ?
      The first Y axis for current measurements, and the second Y axis for power measurements.
      If this is possible, how could I do this ?
      #2. Is it possible to display a logo on the graph display window ? Do you have an example on how to do this ?

      I thank you in advance for your reply and have a nice day.

      With kind regards,

      Sue
    • Hi Sven,

      I thank you very much for your reply.

      #1. Yes, I have done this. I had thought that the 2nd scale could be more complicated to do....

      #2. I have been working on this function GRAPH_SetUserDraw() to implement the company logo.
      Indeed, the WIDGET_GraphXY.c example has got this function, so it helps to understand how it should be done.

      Have a nice day and with kind regards,

      Sue