------------------------------------------------------------------------------
| 422 | |
| 423 | //------------------------------------------------------------------------------ |
| 424 | vtkChart* vtkChartMatrix::GetChart(const vtkVector2i& position) |
| 425 | { |
| 426 | if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY()) |
| 427 | { |
| 428 | std::size_t index = position.GetY() * this->Size.GetX() + position.GetX(); |
| 429 | if (this->Private->ChartElements[index] == nullptr) |
| 430 | { |
| 431 | vtkNew<vtkChartXY> chart; |
| 432 | this->Private->ChartElements[index] = chart; |
| 433 | this->AddItem(chart); |
| 434 | chart->SetLayoutStrategy(vtkChart::AXES_TO_RECT); |
| 435 | } |
| 436 | return vtkChart::SafeDownCast(this->Private->ChartElements[index]); |
| 437 | } |
| 438 | else |
| 439 | { |
| 440 | return nullptr; |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | //------------------------------------------------------------------------------ |
| 445 | bool vtkChartMatrix::SetChartSpan(const vtkVector2i& position, const vtkVector2i& span) |