[vtkusers] Problem with vtkChartXY::SetTitle and vtkAxis::SetTitle

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Nov 15 10:26:33 EST 2011


On Tue, Nov 15, 2011 at 10:08 AM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> On Thu, Nov 3, 2011 at 2:51 PM, Joseph Melnyk <JMelnyk at pile.com> wrote:
>> I actually have a similar, but different problem.  I just upgraded to 5.8.0, after using 5.7 for months.  I'm not having any issues with setting the title of a vtkAxis but I'm having trouble setting the font size for it.  My existing code has no effect:
>>
>> int fontSize = 15;
>> for(int i=0; i < chart->GetNumberOfAxes() ;i++)
>> {
>>        chart->GetAxis(i)->GetTitleProperties()->SetFontSize(fontSize);
>>        chart->GetAxis(i)->Update();
>> }
>>
>> If I check the font size of each axis before/after setting it, it's correct (12 before, 15 after); but there's certainly no visual difference.  Similarly, using SetBold() or SetColor() has no effect.  But note that before initialization of my associated vtkContextView, SetColor(), SetBold() and SetFontSize() all work just fine.  The above code needs to run after initialization.  And again, it worked with no issues before.
>
> I will see about getting an additional regression test in to verify
> that this works. Looking at the code, it should work (and without
> calling Update() on the axis). We use this in ParaView through the GUI
> for example.

I was just looking at this in ParaView, and it looks like a regression
has crept in. It may be the new label caching code not invalidating in
places where it should - leave it with me.

Marcus



More information about the vtkusers mailing list