Question about vtkChartXY

Hi all.

I have a question about the properties of the vtkChartXY.

Question1)
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 =
	vtkSmartPointer<vtkChartXY>::New();

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

But there is nothing the change.

Question2)
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->SetWidth(0.1);
points = chart->AddPlot(vtkChart::POINTS);
points->SetInputData(table, 0, 2);
points->SetColor(255, 0, 0, 255);
points->SetWidth(0.1);

But it also nothing change.

Could you please advise for me?

Thank you :slight_smile:

Maybe this will help
https://lorensen.github.io/VTKExamples/site/Cxx/Plotting/BarChart/

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: