| 697 | } |
| 698 | |
| 699 | void XChart::Redraw() { |
| 700 | if(!canvasContext_->IsValid()) { |
| 701 | return; |
| 702 | } |
| 703 | auto startTimeStamp = xg::CurrentTimestampAtMM(); |
| 704 | |
| 705 | // 7.-1 beforeDraw |
| 706 | // this->logTracer_->trace("%s", "before Redraw and call canvas clearRect"); |
| 707 | // canvasContext_->ClearRect(margin_[0], margin_[1], width_, height_); |
| 708 | |
| 709 | this->legendController_->Redraw(*this); |
| 710 | |
| 711 | // 6. canvas draw |
| 712 | this->logTracer_->trace("%s", "canvas#start Redraw"); |
| 713 | this->canvasContext_->Reset(); |
| 714 | this->canvas_->Draw(GetCanvasContext()); |
| 715 | |
| 716 | renderDurationMM_ = xg::CurrentTimestampAtMM() - startTimeStamp; |
| 717 | |
| 718 | long count = this->canvasContext_->GetRenderCount(); |
| 719 | this->logTracer_->trace("%s renderCount: %ld, duration: %lums", "canvas#endRedraw", count, renderDurationMM_); |
| 720 | } |
| 721 | |
| 722 | std::map<std::string, std::vector<legend::LegendItem>> XChart::GetLegendItems() { |
| 723 |
nothing calls this directly
no test coverage detected