Ask a questionAsk a question
 

Questionsimple zoom for web charts

  • Monday, November 02, 2009 4:12 PMphiljay765 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm sure someone must have nailed this already. I have a chart, bound to a data table which is in viewstate. I currently have a Jquery date-range control to let users zoom into the chart; they pick a range, I set the chart x-axis on postback, it's all good.

    I want to replace that with a simple "click to zoom" thing, where if you click the right hand side of the chart it zooms to that half; else it zooms to the left half. I can see from here and the samples how to do a client-side click-handler on the image, and that works well enough, but my chart has series and strip lines in it, and the simple JS image postback doesn't work there. So I can add postback url handlers for the series, and I can probably work out how to add them for the strip lines, but then I need to work back from those to the x-ordinate, which is actually all I need.

    I have a feeling I'm missing something simple here. Maybe I should just overlay the whole thing on the client with something with a simple JS click handler on it, but that won't work because then I'll lose my tool-tips...

    Does anyone know the easy way to do this - so far, putting a JS date range control in there was easy compared with this thing. Bear in mind this is the web version, so there's no support for zoom there. Yes, I know about Silverlight, but it's not appropriate here thanks.

    How about removing the "usemap" tag with JQuery or something - anyone tried that?
    I tried just overlaying the whole thing with a DIV with a click handler on it, and that works fine of course, but then I lose my hover-text on the series points and stuff... looks like I can't have it both ways on this one.