[vtkusers] vtkChartXY - Initialize to a specific axis range
Scott Fowler
s.fowler at tecplot.com
Thu Oct 21 16:49:28 EDT 2010
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101021/f87588c6/attachment.htm>
More information about the vtkusers
mailing list