[vtkusers] Chart question

Eric E. Monson emonson at cs.duke.edu
Fri Nov 19 10:03:47 EST 2010


Hey David,

My feeling is that there isn't a nice, clean way to do this right now. I would be tempted to subclass vtkAxis and add in a custom event which would allow you to watch for when the max and min values change (which are in the data coordinates) and then recalculate your data based on that, feeding in a new input table to the plot. Because the ChartXY axes are kept in a private data storage, it may force you to re-implement a lot of the ChartXY methods just to change the axis class, though...

Since you would have to deal with panning, rubber-band zooming and mouse wheel zooming, it might be a pain, but in principle you could just observe all of the important mouse events for the chart's interactor and then check whether the axis ranges have changed.

I'm having a little trouble thinking through, though, what will happen with the auto axis ticks and plot bounds when you're constantly changing the input data... You'll want it to do auto-nice axis ticks and labels rather than doing it manually, but I'm not sure if the default behavior will be to try to rescale the axis ranges to the data range (which may be fine for you in one direction but not the other), and whether that will cause some weird jumpiness or whether it will be okay...

Probably Marcus will have some better ideas.

Talk to you later,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Nov 18, 2010, at 4:56 PM, David Thompson wrote:

> Hi all (but especially Marcus or Eric or those familiar with the new charts),
> 
> I have a function defined over the entire real line which I would like to illustrate using vtkChartXY and a vtkPlotLine instance. However, I can't create a dataset to feed vtkPlotLine that specifies the function over infinite extents. Instead, when the user pans or scales the plot, I'd like to get new axis extents and update the dataset which vtkPlotLine uses. Does anyone know a good way to react to pans and zooms and retrieve the new axis extents, scaled to dataset coordinates?
> 
> 	Thanks,
> 	David
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list