Jump to content
Software FX Community

Rescaling a date x-axis automatically when series are deselected


Recommended Posts

Posted

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

I have a chart where I plot any number of time series against a common x axis (date) and common y axis. (values). The time series may have different start points / end points, and I have a separate list box to select which series should be displayed. Implementation-wise, I am populating a data table based on the selection, but currently do not remove it from the data table when it is deselected, just set the series as not visible.

 

Now, when I deselect a time series, I want the x-axis to rescale according to the start/end points of the displayed time series. Just setting the visible property to false on the series (like I do now) just hides it, and does not rescale the x axis.

 

This can of course be done by repopulating the data table over again when the selection is changed and redrawing the full chart, but this is very inefficient when a large number of long time series is displayed, and I just want to deselect one of them.

 

Anyone with similar problems/solutions? I tried to write a method to get the min/max data values from the series and use this to set the min/max values of the xaxis, but ran into problems, has anyone got some example code for this? And in any case I was hoping this automatic rescaling is behaviour I could set with a parameter in the chart, but it does not seem so.

 

Thanks for any hints. Just let me know I if can post some code to illustrate the problem.

 

Knut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...