[vtkusers] vtkChartXY - Initialize to a specific axis range

Eric E. Monson emonson at cs.duke.edu
Thu Oct 21 20:34:22 EDT 2010


Hey Scott,

vtkAxis has a SetBehavior() method, and if you pass each one vtkAxis::FIXED before setting your ranges they shouldn't get reset. 

http://www.vtk.org/doc/nightly/html/classvtkAxis.html

Let us know if that doesn't work for you for some reason.
-Eric

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


On Oct 21, 2010, at 4:49 PM, Scott Fowler wrote:

> I'd like to create a vtkChartXY and initialize it with a specific axis range, however the axis range gets reset during the first Paint event.  Do I have to delay setting my axis ranges until after the Paint event, or is there a better way?
>  
> Code:
> void createChart(vtkTable* data)
> {
> plot = new vtkPlotPoints;
> plot->SetInput(data);
> chart = new vtkChartXY;
> contextView = new vtkContextView;
> contextView->GetScene()->AddItem(chart);
> chart->AddPlot(plot);
> chart->GetAxis(0)->SetRange(200,400);
> chart->GetAxis(1)->SetRange(2,7);
> }
>  
> Paint gets called sometime after this method returns, causing my axis ranges to get reset.  How do I avoid this?
>  
>  
> Scott
> 
> This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are NOT the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying this e-mail is strictly prohibited.
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101021/67173e0c/attachment.htm>


More information about the vtkusers mailing list