Question about vtkChartXY

Hi all.

I have a question about the properties of the vtkChartXY.

I want to change the color of the axis’s label.

I think the ① is the ‘label’, and ② is the ‘title’.
So, I tried to test the code as below:

vtkSmartPointer<vtkChartXY> chart =

vtkAxis* axis = chart->GetAxis(vtkAxis::LEFT);
axis->GetPen()->SetColor(255, 255, 255, 255);
axis->GetLabelProperties()->SetColor(255, 0, 0);
axis->GetTitleProperties()->SetColor(255, 0, 0);

But there is nothing the change.

How to change the size of the points?
I tried to the code as below:

vtkPlot *points = chart->AddPlot(vtkChart::POINTS);
points->SetInputData(table, 0, 1);
points->SetColor(0, 255, 0, 255);
points = chart->AddPlot(vtkChart::POINTS);
points->SetInputData(table, 0, 2);
points->SetColor(255, 0, 0, 255);

But it also nothing change.

Could you please advise for me?

Thank you :slight_smile:

Maybe this will help

The axis labels are changed.

Hi Bill!

Thank you!

I can change the axis labels!

And, do you know the value of minimum vtkPlot width size?
I have tested the vtkPlot’s ‘SetWidth’ API with changing the value.
I think the value below 0.5 looks the same.

Thank you :slight_smile: