problems with cursor, grid replotting, and clipping

Get help and support using chartsEngine for LiveCode.

Moderators: heatherlaine, BvG

Post Reply
Steve
Posts: 30
Joined: Fri Nov 07, 2008 10:46 pm
Location: Iowa, U.S.A.
Contact:

problems with cursor, grid replotting, and clipping

Post by Steve » Thu May 26, 2011 2:50 pm

We have just purchased and begun using Charts Engine at the University of Bergen (Norway).

We are encountering three significant problems.

1. We execute "chartsRefresh" in a loop to dynamically plot a graph. But Charts Engine keeps changing the cursor to an hourglass, which causes our user interface great problems. Locking the cursor has no effect, so does not solve the problem.

2. When refreshing (that is, doing a "chartsRefresh") within a loop, the graph grid will occasionally (and reliably) change. We have absolutely no commands modifying the grid within the loop, and our minimum and maximum x and y are set, so the graph grid should be stable. But it will change consistently as certain points, e.g., always changes after 10 seconds.

3. The charts["minY"] and charts["maxY"] commands do not work as expected, or as would make sense mathematically (for some purposes) The documentation on these commands is very poor and incomplete. There is mention of "scrolling through a dataset" but it is not clear what that means. Our main problem is that our applications generate points that are outside of the graphs range. We set min and max because we don't want the grid or the axis labels to change. But when a point is above the top of the grid, Charts Engine simply plots the maximum value. This is not what one would want to do in many instances. One would want the line to simply be hidden above the top of the graph. For example, if my y maximum is 100 and I plot from (1,1) to (10,1000), Charts Engine draws a line from (1,1) to (10,100). What I want (and what usually makes more sense, mathematically), is for the line to go from (1,1) to (10,1000), but disappear as it goes above 100 (the top of the graph) dissappearing at about (2,199), (I'm interpolating very roughly). I have ways to mathematically correct for this problem, but it REALLY is a case where Charts Engine is not behaving in a proper mathematical fashion.

Problem 3 I can use a cludge to correct for. But problems 1 and 2 are not in any way avoidable when running within a loop.

Sincerely,

Steve Alessi
The University of Iowa and the University of Bergen

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: problems with cursor, grid replotting, and clipping

Post by BvG » Sat May 28, 2011 4:49 pm

Hi Steve

Thank you for your query. It is always exciting to see how people are using chartsEngine.
I am sorry for the late reply. It seem the forum doesn't put all posts into the "new posts" page :(
1. We execute "chartsRefresh" in a loop to dynamically plot a graph. But Charts Engine keeps changing the cursor to an hourglass, which causes our user interface great problems. Locking the cursor has no effect, so does not solve the problem.
Hmm, this was added for slower charts like doughnut, so people could see what's going on. There's three options for me. Either remove it, or make a property that you as a user can set to true or false, or to automatically omit it for specific charts. I have noted the problem and will have one of these changes in the next version of chartsEngine.
2. When refreshing (that is, doing a "chartsRefresh") within a loop, the graph grid will occasionally (and reliably) change. We have absolutely no commands modifying the grid within the loop, and our minimum and maximum x and y are set, so the graph grid should be stable. But it will change consistently as certain points, e.g., always changes after 10 seconds.
The size of the grid does not only depend on it's own settings, but also on the label sizes. I assume this is causing the problem here. But if it is not, I probably need to see how you draw the graph, to understand where the problem comes from. Now if it is the lables, this is what happens:
Basically, I am assuming your data is getting bigger with each iteration. The x axis label then increases from 99 to 100 (for example). That will cause the labels to change size, and the grid shrinks a bit. Barring a completely change from the ground up, this will remain the same. But there are quite a few workarounds:

Code: Select all

 --not showing labels
set the charts["showGridXDescription"] of grp "myChart" to false
set the charts["showGridYDescription"] of grp "myChart" to false
--using numberformat to accommodate for change to numbers size (see also the build in numberFormat property of LC for valid entries) 
set the charts["gridYNumberFormat"] of grp "myChart" to "000000"
set the charts["gridXNumberFormat"] of grp "myChart" to "0000.000"
--if x values are the problem:
set the charts["gridXDescriptionOrientation"] of grp "myChart" to "left" -- "right" works too
--also for x values, if they are times (see "convert" command of LC for valid entries)
set the charts["xConvertsTo"] of grp "myChart" to "seconds"
3. The charts["minY"] and charts["maxY"] commands do not work as expected, or as would make sense mathematically (for some purposes) The documentation on these commands is very poor and incomplete. There is mention of "scrolling through a dataset" but it is not clear what that means. Our main problem is that our applications generate points that are outside of the graphs range. We set min and max because we don't want the grid or the axis labels to change. But when a point is above the top of the grid, Charts Engine simply plots the maximum value. This is not what one would want to do in many instances. One would want the line to simply be hidden above the top of the graph. For example, if my y maximum is 100 and I plot from (1,1) to (10,1000), Charts Engine draws a line from (1,1) to (10,100). What I want (and what usually makes more sense, mathematically), is for the line to go from (1,1) to (10,1000), but disappear as it goes above 100 (the top of the graph) dissappearing at about (2,199), (I'm interpolating very roughly). I have ways to mathematically correct for this problem, but it REALLY is a case where Charts Engine is not behaving in a proper mathematical fashion.
I am aware of the rather... basic rounding with offscreen values. I am not happy with that, and it is something I am looking to rectify. However, at this time I cannot give a clear and simple time for when which chart is fixed. There's quite a few of these problems with min and max, and I am trying to change one at a time. The line graphs cropping problem is one of those, and I hope to have it fixed in the next version, but am reluctant to promise anything at this point.

If you are dependant on changes for your project, I will try to fix them first, and make a beta version available. Please contact me per email in such a case: me at bjoernke dot com
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply

Return to “chartsEngine”