NetTalk Central

Author Topic: LIne Graph Gets bigger every time refreshed  (Read 6048 times)

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
LIne Graph Gets bigger every time refreshed
« on: March 10, 2018, 12:45:47 AM »
I have an application with 7 graphs (Insight Graphing).  The first 6 work perfectly with data input from static files. In all of these cases I specify the Y-axis min and max values (auto scale OFF).

The 7th is loaded from a file which contains data based on 'Owner' and Owner can be changed via a drop-down on the Window that encloses the graph.  When a new Owner is chosen and a Button ('Refresh Data') is pushed the Server Side code deletes all of the records in the file and reloads with those from the new Owner.

On the Button, the Graph Procedure is set to Refresh.  When the graph first displays it is ok.  When it is subsequently displayed with new Owner data it gets bigger, and then bigger until it overflows the screen

The Y axis Min is set to 0 and Max is set to 60.  None of the Y value data points exceed 46.

Any idea about what can be wrong?

Thanks

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: LIne Graph Gets bigger every time refreshed
« Reply #1 on: March 11, 2018, 11:00:16 PM »
>> ... pushed the Server Side code deletes all of the records in the file and reloads with those from the new Owner.

sounds to me like this bit of code is not working right for you. You might want to test/debug this to make sure all the earlier records are being deleted.

and presumably this file is bound to a SessionID, and the graph filters so only data from that sessionID is displayed?

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: LIne Graph Gets bigger every time refreshed
« Reply #2 on: March 12, 2018, 12:53:02 AM »
Thanks Bruce

Checked that the data is being deleted correctly when a new Owner is selected.  However I then stripped this down to basics.  The graphs run off files.  The files that feed all of the graphs that work are static.  The one where the graph window gets ever bigger (and sometimes reverts to the correct size!) runs off the file that is reseeded.  So I bypassed the embed code which deletes and reseeds the records. This meant that the items on the Window including the Graph procedure were simply being Reset and the Graph was of the same data.

The result was the same!  Reiterating:  Press the NewGraph button, no delete or insert code executed (i.e. run off current file) and the displayed graph (same data points) varies in size on each iteration.

I am creating a cut down app which demonstrates.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: LIne Graph Gets bigger every time refreshed
« Reply #3 on: March 12, 2018, 02:06:47 PM »
Hi, the attached zip file contains the app, dct, files and the exe. The files should be in the same folder as the exe.

If you go here: http://101.98.111.186:24040/ you can choose 'Visualise' and 'Device Owners' then press 'Refresh Information' a couple of times and you will see the graph changing size.

In the attached app I have bypassed the code that would normally run to load new owner data so that all that is happening when the button is pushed is that the fields (including the graph) are being Reset.

Thanks for any advice.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: LIne Graph Gets bigger every time refreshed
« Reply #4 on: March 13, 2018, 03:22:04 AM »
Hi Keith,

>> When it is subsequently displayed with new Owner data it gets bigger, and then bigger until it overflows the screen

so this is the magic sentence, that I only sort-of got. You mean it gets _physically_ bigger, not that it contains more data (which is how I understood it.)

The physical size is controlled by the actual Insight control size (and hence the window size). You've got the Window resize Extension template on the GetOwnerData procedure. Remove that and you should be fine.

cheers
Bruce



Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: LIne Graph Gets bigger every time refreshed
« Reply #5 on: March 13, 2018, 01:18:27 PM »
Thanks Bruce.  I had the Window resize Extension template on all of the graphs and so have removed it.  With the code reinstated that reloads the data the graph behaves.

When you create a new Window and add the Insight Control the 'offending' Extension seems to be added automatically.  If this was going to cause the problem that I encountered then maybe the conditions should be documented (they may already be documented but I didn't come across anything along those lines).

I still don't understand why, with the same data being loaded on each Refresh the Resize Extension allows the size of the graph to exponentially increase (irrespective of the maximum Y-axis value) but now that its fixed I won't be worrying about it :-)

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27