1 Reply Latest reply on Aug 4, 2006 12:43 PM by peterent

    Working with line chart

      I am using line charting component and wondering is it possible to select on part of series and perform zooming?
      If anyone has an idea, please drop here. Thanks.
        • 1. Re: Working with line chart
          peterent Level 2
          Do you mean to physically zoom the chart by changing its scaleX and scaleY properties, or do mean to select a portion of the data (say from Jan - Mar 2006) and chart those values?

          If it is the latter, there are a couple of ways to do this:

          Use a Slider (HSlider or VSlider) with 2 thumb controls. One will represent the minimum value and one the maximum value. Be sure to set the slider's minimum and maximum to those of the axis you are zooming on. Or use 0 and 1 and treat the slider as a percentage value. Once you have the two values, recalibrate your data access or use the values to adjust the axis minimum and maximum values (if using a LinearAxis) and the chart will automatically redraw.

          Another option is to do something interactively. Place the chart into a Canvas, then track the mouse down and up events on the Canvas. When you get those values, translate their coordinates to those of the chart. Once you have those x values (assuming a column chart), you can map them to the chart's X axis domain and adjust the X axis values (if using a LinearAxis) and the chart will automatically zoom the values. This is obviously a bit harder, but way cooler.