Discussion:
[vtkusers] vtkChartXY: Rotate or flip a 2D Chart
AzDTo
2014-09-04 14:48:28 UTC
Permalink
HI,

Is there a way that I can make Rotating a *2D VTK Chart * 90 Degrees to the
left or 90 degrees to the right?

Like this:
<Loading Image...>

I take an example code from
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot

thanks



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-Rotate-or-flip-a-2D-Chart-tp5728574.html
Sent from the VTK - Users mailing list archive at Nabble.com.
AzDTo
2014-09-09 06:52:24 UTC
Permalink
Here is the Part of code Source:

create a Chart..
.....
..
.
//rotate (90) a chart
pImpl->verticalModeTransform =
vtkSmartPointer<vtkContextTransform>::New();
pImpl->verticalModeTransform->AddItem(pImpl->chart);
pImpl->verticalModeTransform->Translate(0.0, sizeY);
pImpl->sizeY = sizeX;

pImpl->verticalModeTransform->Rotate(90);
pImpl->chart->SetAutoSize(true);
pImpl->chart->SetSize(vtkRectf(0.0, 0.0, sizeY, sizeX));
pImpl->view->GetScene()->AddItem(pImpl->verticalModeTransform);
...
..
.

the result Looks like this:
Default Chart
rotate to 90 degree
<Loading Image...>
<Loading Image...>

thanks again



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-Rotate-or-flip-a-2D-Chart-tp5728574p5728619.html
Sent from the VTK - Users mailing list archive at Nabble.com.
Butterfly
2014-09-11 07:54:07 UTC
Permalink
Your chart is rotated, seems like you solved your problem yourself :)



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-Rotate-or-flip-a-2D-Chart-tp5728574p5728667.html
Sent from the VTK - Users mailing list archive at Nabble.com.

Loading...