[vtkusers] Setting the X axis of VtkChartsXY

Darshan Pai darshanpai at gmail.com
Wed Mar 14 16:39:48 EDT 2012


Thanks Marcus , it works

I do have one more question though . Is there any way to change the
tooltip? I mean that when you hover the mouse on the line, I get the x and
y axis value of the point. Since I have custom labels for the X axis, can I
also modify the tooptip value to reflect that label.

Regards
Darshan

On Wed, Mar 14, 2012 at 9:57 AM, Marcus D. Hanwell <
marcus.hanwell at kitware.com> wrote:

> On Sun, Mar 11, 2012 at 5:52 PM, Darshan Pai <darshanpai at gmail.com> wrote:
> > I have a a set of Ids which are strings . Sample :- ( FP1,FP2.....
> > FP10,AP1,AP2....AP10) etc
> > For each ID I have a double value .
> > I want to map the strings to the X-axis in the same order that I see the
> > strings. I have all this information in a vtkTable.
> > How do I arrange the vtkChartXY to do precisely this .
> >
> Any axis on a chart can have custom labels. I notice now that there is
> no test, but this can be done from ParaView for example.
>
> vtkAxis *axis = chart->GetAxis(vtkAxis::BOTTOM);
> axis->SetBehavior(vtkAxis::CUSTOM);
> axis->SetTickPositions(positions);
> axis->SetTickLabels(labels);
>
> You would need a vtkDoubleArray with the label positions, and a
> vtkStringArray with the custom labels. They should both be of the same
> length.
>
> Thanks,
>
> Marcus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120314/829d21e6/attachment.htm>


More information about the vtkusers mailing list