MCPcopy Create free account
hub / github.com/antvis/F2Native / XChart

Method XChart

core/graphics/XChart.cpp:21–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace std;
20
21XChart::XChart(const std::string &name, double width, double height, double ratio, bool log) : chartName_(name) {
22 SetName(name);
23 width_ = width * ratio;
24 height_ = height * ratio;
25 ratio_ = ratio;
26 this->logTracer_ = new utils::Tracer(name + "@Chart", log);
27 this->logTracer_->trace("create xchart: %s %lf %lf %lf ", chartId_.c_str(), width_, height_, ratio_);
28 this->darkModeManager_ = new token::DarkModeManager(name);
29
30 geomShapeFactory_ = xg::make_unique<geom::shape::GeomShapeFactory>();
31
32 // 初始化度量控制器
33 scaleController_ = new scale::ScaleController();
34 this->logTracer_->trace("%s", "new ScaleController instance.");
35 // 画布
36 this->canvas_ = new canvas::Canvas();
37 this->logTracer_->trace("%s", "new canvas instance.");
38 // 布局层级
39 this->InitLayout();
40
41 axisController_ = new axis::AxisController(backLayout_->AddGroup());
42 this->logTracer_->trace("%s", "new axisController instance.");
43 guideController_ = new guide::GuideController(frontLayout_->AddGroup(), backLayout_->AddGroup());
44 this->logTracer_->trace("%s", "new guideController instance.");
45 legendController_ = new legend::LegendController(backLayout_->AddGroup());
46 this->logTracer_->trace("%s", "new legendController instance");
47
48 eventController_ = new event::EventController();
49 this->logTracer_->trace("%s", "new eventController instance.");
50
51 geomAnimate_ = new animate::GeomAnimate(this);
52 this->logTracer_->trace("%s", "new GeomAnimate instance.");
53}
54
55XChart::~XChart() {
56 func::FunctionManager::GetInstance().Clear(this->GetChartId());

Callers

nothing calls this directly

Calls 3

InitLayoutMethod · 0.95
traceMethod · 0.80
AddGroupMethod · 0.45

Tested by

no test coverage detected