Min/Max X/Y clarification

Get help and support using chartsEngine for LiveCode.

Moderators: heatherlaine, BvG

Post Reply
dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Min/Max X/Y clarification

Post by dglass » Tue Jun 28, 2011 4:51 am

chartsEngine Docs wrote:charts["minX"] charts["maxX"] charts["minY"] charts ["maxY"]
Summary:
If set to a number, that value will be used as a minimum value for the xAxis. If set to a number, that value will be used as a maximum value for the xAxis. If set to a number, that value will be used as a minimum value for the yAxis. If set to a number, that value will be used as a maximum value for the yAxis.
Examples:
set the charts["minX"] of grp "myChart" to -2 set the charts["maxX"] of grp "myChart" to 500
set the charts["minY"] of grp "myChart" to 0 set the charts["maxY"] of grp "myChart" to 500
Comments:
Setting these properties allow you to scale the amplitude for a chart and also to scroll through a dataset. If values are outside the boundaries of the minY and maxY values, the chart will clip though.
Could you explain what 'scroll through a dataset' means in this context?

I've interpreted it to mean that the graph will show a scroll bar to allow scrolling to the max/end point of the graph, is that correct?

I'm attempting to create a Stacked Line chart that has dates on the X-axis, and I'd like to specify a date sometime in the future as the max, and have the graph show a horizontal scroll bar to allow the user to scroll into the future.

What is happening, however, is that the graph gets compressed so the min is whatever it is, the max is the future date, and there are only 3 grid lines between the two.

If it is relevant, my test data only has 3 datapoints (monthly), for 4 series, and I'm setting my max out 5 months.

Do I need to specify 'empty' datapoints for all the 'stops' between the min and the max?

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

Re: Min/Max X/Y clarification

Post by BvG » Sat Jul 02, 2011 3:11 pm

dglass wrote:Could you explain what 'scroll through a dataset' means in this context?
Basically it is a comment about animated graphs. To have a graph "move" trough a larger set, it's easiest to set all properties, then repeatedly change minX and maxX to make a rolling animation. There are no scroll bars added, there is no feature to do that, but you can of course put the whole graph into a scrolling group and scroll it as a whole. I've added a feature request to be able to scroll only the data within the grid, while keeping the description stuff in place.

I think you also tried to set the max to something larger then the current dataset, that should work as expected, I think. Namely it should extend the visible area to beyond your dataset, and show empty space in the chart if you for example have a max value of 10, and set the charts["maxX"] to 20.

Also note that grid lines are determined by charts["gridX"] and charts["gridY"], not by how many data points you currently show, or what maxX (etc.) say.
Various teststacks and stuff:
http://bjoernke.com

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

dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Re: Min/Max X/Y clarification

Post by dglass » Sat Jul 02, 2011 4:04 pm

BvG wrote:
dglass wrote:There are no scroll bars added, there is no feature to do that, but you can of course put the whole graph into a scrolling group and scroll it as a whole.
This caused issues with the chart display when I tried it.
LiveCodeScreenSnapz023.jpg
Note the first series has been placed up and outside the axes bounds.

EDIT: just saw the other post about putting the chart group in another group and setting the scroll of that second, containing group. That might solve the issue.

I think I'll go with changing the min and max of the chart as the user requires (via button presses) though, and see how that works out.

Post Reply

Return to “chartsEngine”