[vtkusers] vtkPlotBar (vtk6): problems with width of bars and axis

Alexandre Boucher afboucher at gmail.com
Fri May 3 14:35:31 EDT 2013


FYI:  Found what is going on with the SetWidth.

The value set by the user in vtkPlotBar::SetWidth (and
vtkPlotBar::SetOffset) are overwritten by vtkChartXY::CalculateBarPlots().
 I understand that this is the behavior that one would like 90% of the
time.  But in my case the width and the offset of each bar plot is critical
to the visualization.  I tried to trick it by setting  GetBarWidthFraction
to 2.0 but it still affect the offset,

The only thing I can see would be to add a flag in vtkChartXY such as
SetAutomaticWidthOffsetCalculation(bool) that would be true by default but
could be disabled when needed (such as in my case).

Regards,
Alex


On Thu, May 2, 2013 at 10:53 PM, Alexandre Boucher <afboucher at gmail.com>wrote:

> Hello all,
>
> I am having two problems:
> 1) I am unable to control the width of the bar in vtkPlotBar
> 2) I cannot set the axis to invisible
>
>
> There is a previous plot in corner 0 that behaves the same way
> ------------------
>   vtkPlotBar* plot = chart_->AddPlot(vtkChart::BAR);
>   chart_->SetPlotCorner(plot, 2);
>   plot->SetWidth( 50  );  // No effect
>   plot->SetInputData(table,1,2);
>
>   vtkAxis *x_axis = chart_->GetAxis(vtkAxis::TOP);
>   x_axis->SetVisible(false);  // No effect
>
>   vtkAxis *y_axis = chart_->GetAxis(vtkAxis::RIGHT);
>   y_axis->SetVisible(false); // No effect
> ----------------------
>
> 1) Whatever I put to SetWidth the plot is unchanged  Looking at the code
> this should change the width of the bar since it is passed to the
> PaintSegments functions.
>
> 2) The vtkAxis::SetVisible(false) has not effect
>
> Anyone has any hints of what I am doing wrong?
>
> Thanks,
> Alex
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130503/333b535c/attachment.htm>


More information about the vtkusers mailing list