[vtkusers] vtkBarChartActor

Riku subs at collab.se
Thu Jun 2 15:19:50 EDT 2011


Hi,

I had the same problem at some stage. I remember that some version (5.6.1 in
fact, I think) of the code has the problem with the orientation of the
labels, but it got fixed in later updates. (The example with the sine/cosine
plots did not render as the example, for example.)

Use the latest release head from git (if you don't already) and I think
you'll be fine.

Riku


On 2 June 2011 15:49, Amitesh Kumar <amiteshagarwal at gmail.com> wrote:

> I am facing a clot of issues in using vtkBarChartActor  to make it render
> as I want it to do. I wonder if anybody here would help me with these issues
> and answer my questions?
>
> vtkBarChartActor *actor = vtkBarChartActor::New();
>
> 1.  I wanted to set the property of the labels on the x-axis for the bars
> to be rendered vertical.  I used
>
> actor->GetLabelTextProperty()->SetOrientation(90);
>
> However no matter what I do, the labels would always be rendered
>  horizontal. What am I missing?
>
> 2. I want to sent the Title text font size to be of a specific size. It
> turns out that the font size is set automatically and is based on the number
> of characters in the Title. If the number of characters in the title is
> less, then the font size would be bigger and vice versa.
>
> actor->GetTitleTextProperty()->SetFontSize(30);
>
> I was trying to use this but it doesn't work or doesn't show any effect.
> What am I missing?
>
> 3.  I can set the YTitle but is there a ways to set XTitle as well?
>
> 4. Y title is always rendered horizontally. Anybody who uses plots, knows
> that this is probably not ideal and a better way would be to rotate the
> y-axis title by 90 degrees so that it is along  y axis. How can this be
> done?
>
> 5. Y-axis labels are always being show as floats (values.00). My values are
> all int and I want it to be rendered as such. How can this be done?. I
> used vtkIntArray as shown in the following but it had no effect in terms of
> how y-labels are rendered.
>
> vtkIntArray *qData = vtkIntArray::New();
> qData->SetNumberOfValues(nPartition);
> for(int i = 0; i <nPartition; i++)
>     qData->SetValue(i,output[i]);
> vtkDataObject *dobj = vtkDataObject::New();
> dobj->GetFieldData()->AddArray(qData);
> vtkBarChartActor *actor = vtkBarChartActor::New();
> actor->SetInput(dobj);
>
> 6. vtkBarChartActor doesn't show X and Y-axes by default. Is there a way to
> switch it on?
>
> 7. Although vtkCharts is probably good step but it lacks so many
> capabilities when compared with, say, gnuplot. Are there any plans to
> include a vtk porting of gnuplot which would be something similar to what
> was done with Sandia's Verdict?
>
> Thank You
>
> Amitesh
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110602/da13501b/attachment.htm>


More information about the vtkusers mailing list