[vtkusers] vtkChartXY with inverted vtkAxis labels

Joseph Melnyk JMelnyk at pile.com
Tue Feb 1 13:07:35 EST 2011


I had previously tried the nightly version but ran into other issues with charts.  Besides those, the new release does address the need for inverted axes; so thanks much for that!

Regarding the other chart issues, I've been looking into those further and their behavior is quite peculiar.  For example, setting the color of the axis title makes the legend go away (even if it's explicitly set to be shown), setting an axis title at all results in it not being shown, setting axis behavior to FIXED results in the tooltips not appearing, etc.  Some of these seem to exist only in my code (which is quite simple); others also appear when I place them into the tests.  Am I missing something here?  Is it perhaps because I'm using them under C++/CLI, with the render window bound to a Windows Form PictureBox?

On a related note, is there an easy way to swap axes?  For example, if I want to have the rows of my table correspond to Y values rather than X values.  I had accomplished this before by swapping column indeces (i.e. vtkPlot->SetInput(table, YColIndex, XColIndex)).  This has the side effect of setting all names in the legend to the X column's index, however.  So I was explicitly setting them then with vtkPlot->SetLabel; but this function doesn't appear to work any longer.  Using it at all results in the legend name being blank.  I could replicate this issue with the tests using C++/CLI and binding the render window to a Windows Form PictureBox.  But using Win32, there's no issue.

So perhaps this is related to use of C++/CLI after all.  I had none of these issues with the 5.6.1 release, fwiw.

Thanks again for your help!




-----Original Message-----
On Mon, Jan 31, 2011 at 12:33 PM, Joseph Melnyk <JMelnyk at pile.com> wrote:
> I'm interested in displaying a vtkChartXY where the vtkAxis for the Y 
> axis has decreasing/inverted labels.  That is, the plot corner is 3 
> (axes on left and top), the X axis is increasing from left to right 
> and the Y axis is increasing from top to bottom (0 at the top).
>
Did you take a look at the TestScientificPlot code in VTK? This test shows an inverted Y-axis.
>
> I've tried a few approaches to this but ultimately, it seems as though 
> setting my min and max correctly should work.  For example, if I want 
> 0 at the top of the Y axis and 50 at the bottom, I would do
> vtkAxis->SetMaximum(0) along with vtkAxis->SetMinimum(50).  Is this 
> vtkAxis->facility
> simply not allowed for within the vtkAxis in the 5.6.1 release?  Or is 
> there another method of achieving this?
>
I am not sure I had this working (or tested) in the 5.6 series, but it is working in what will soon be released as 5.8. I would advise that you try VTK from master, and let me know if you hit any issues.

Thanks,

Marcus
_______________________________________________
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

_Scanned by MessageLabs

__Scanned by MessageLabs



More information about the vtkusers mailing list