<div dir="ltr">hi all,<div><br></div><div>I am trying to utilize vtkChartXY to plot a simple 2D curve but ran into some trouble, I seek your help.</div><div><br></div><div>The 2D plot is a function of time and is been updated incrementally. I tried to follow the example at:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot</a><br></div><div><br></div><div>to create an initial plot. As the data come in, I extended the vtkTable, and calls the renderer again, but only the initial table/plot was shown. A code demonstrating is the follow. Basically what I did was:</div><div><br></div><div>- create a vtkTable with 3 data point, and plot it,</div><div>- modify the vtkTable to include 1 more data point (4 total), and plot it again,</div><div>- but the resulting plot only shows the original curve.</div><div><br></div><div>Any help is very much appreciated,</div><div><br></div><div>thanks,</div><div><br></div><div><br></div><div><br></div><div><div>// arrX and arrY are vtkFloatArray</div><div><br></div><div>  table->AddColumn( arrX );</div><div>  table->AddColumn( arrY );</div><div><br></div><div>// create a table of 3 data points</div><div>  table->SetNumberOfRows( 3 );</div><div>  table->SetValue( 0, 0, 0 );</div><div>  table->SetValue( 0, 1, 0 );</div><div>  table->SetValue( 1, 0, 1 );</div><div>  table->SetValue( 1, 1, 1 );</div><div>  table->SetValue( 2, 0, 2 );</div><div>  table->SetValue( 2, 1, 3 );</div><div><br></div><div>// render the chart</div><div>  view->GetRenderer()->SetBackground( 1, 1, 1 );</div><div>  view->GetScene()->AddItem( chart );</div><div>  chart->SetShowLegend( true );</div><div>  line = chart->AddPlot( vtkChart::LINE );</div><div>  line->SetInput( table, 0, 1 );</div><div>  line->SetColor( 1, 0, 0 );</div><div>  line->SetWidth( 5.0 );</div><div>  </div><div>// shows a plot of 3 data point</div><div>  view->GetRenderer()->Render();</div><div><br></div><div>// add a new point to the vtkTable</div><div>  table->SetNumberOfRows( 4 );</div><div>  table->SetValue( 0, 0, 0 );</div><div>  table->SetValue( 0, 1, 0 );</div><div>  table->SetValue( 1, 0, 1 );</div><div>  table->SetValue( 1, 1, 1 );</div><div>  table->SetValue( 2, 0, 2 );</div><div>  table->SetValue( 2, 1, 3 );</div><div>  table->SetValue( 3, 0, 5 );</div><div>  table->SetValue( 3, 1, 5 );</div><div>  table->Modified();</div><div>  view->Modified();</div><div>  line->Modified();</div><div><br></div><div>// render it again, but still, only 3 data points were plot</div><div>  view->GetRenderer()->Render();</div><div>  view->GetInteractor()->Initialize();</div><div>  view->GetInteractor()->Start();</div></div><div><br></div><div><br></div><div><br></div></div>