[vtkusers] Different widths for bars in a vtkChart?

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Mar 12 17:10:01 EDT 2013


On Tue, Mar 12, 2013 at 5:02 PM, CuriousGTime <chrisportka at gmail.com> wrote:
> I have a histogram I'm making using vtkChart, but it seems like all the bars
> for my chart must be the same width.  Is there a way to have varying widths
> for the bars?
>
> I define a vtkTable with two columns, the first is the starting x value of
> the bar and the second column is the value (y height) of the bar.  I then
> call AddPlot(vtkChart::Bar) on my vtkChart and then call SetInput(table, 0,
> 1) on the resulting vtkPlot.  However, the resulting plot has the bars only
> start on the x value with all the same width.  I would like to be able to
> specify each individual bar's width.  Is this possible?
>
> Thanks for any help and suggestions!
>
No, you can change the widths of the bars but there is no code to vary
them individually. You would have to extend the class that renders the
bars.

Marcus



More information about the vtkusers mailing list