I have time series data and I would like to interactively select a part of it. This problem is beautifully solved in the lower part of the InteractiveTradingChart command:

enter image description here

I would like to be able to do the same for my own data. Before I reinvent the wheel I would like to know if this is already available somewhere. In case I do have to reinvent it, this is what I have already done:



        Epilog->{EdgeForm[Gray], FaceForm[Cyan], Opacity[0.5],
                 Rectangle[{x-windowSize/2, 0},
                           {x+windowSize/2, Max[Last/@data]}], 
                 FaceForm[LightGray], Opacity[1], 
                 Rectangle[{x-1.05windowSize/2, .25Max[Last/@data]}, 
                           {x-0.95windowSize/2, .75Max[Last/@data]}],
                 Rectangle[{x+0.95windowSize/2, .25Max[Last/@data]},
                           {x+1.05windowSize/2, .75Max[Last/@data]}]
            {AbsoluteTime[{2013,1,1}], AbsoluteTime[{2013,12,31}]},
            Appearance->"UpArrow", ImageSize->640]}}]]

Mathematica graphics

  • $\begingroup$ I think "Second" needs to become "Seconds" for the UnitConvert to work. $\endgroup$ – Jagra Mar 15 '13 at 13:37
  • $\begingroup$ This will take someone sometime to develop a solution. I think any of us will get there faster if we have more specifics about what you want to do. Your supplied code gives a nice window on the data that moves with the slider. It looks like you may want to adjust the size of this window and then link this complex control to the display of another set of data, essentially zooming in and out on the data. I like this idea a lot and have implemented some similar things. Let's make certain about what you want from your question. Please clarify the question before anyone heads down a wrong path. $\endgroup$ – Jagra Mar 15 '13 at 13:45
  • 1
    $\begingroup$ Mike Honeychurch has an interesting blog post about this. $\endgroup$ – Leonid Shifrin Mar 15 '13 at 13:52
  • $\begingroup$ @LeonidShifrin - Mike's blog post looks more than interesting! He nails it. Now if Mr. Wizard took up the challenge he might just render the entire code in 27 characters, but short of that Mike deserves credit for the answer ;-)> $\endgroup$ – Jagra Mar 15 '13 at 14:50
  • $\begingroup$ @LeonidShifrin Thank you. This is what I needed. $\endgroup$ – Gustavo Delfino Mar 15 '13 at 16:10

To put Leonids comment into an answer: Please see the blog-post of Mike Honeychurch at ibnhconsulting.blogspot.ru. This should help you.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.