25 axis_t<plot> top_axis {*
this, {1,0}, {0,-1}, {1,0},
false, 20, 50};
26 axis_t<plot> bottom_axis {*
this, {1,0}, {0,1}, {1,0},
true, 20};
27 axis_t<plot> left_axis {*
this, {0,-1}, {-1,0}, {1,0},
true, 30, 60};
28 axis_t<plot> right_axis {*
this, {0,-1}, {1,0}, {1,0},
false, 25, 55};
32 explicit plot(std::initializer_list<data_series_t>&& series_): cydui::components::component_t<
plot>(), props(series_) {
33 for (std::size_t i = 0; i < series_.size(); ++i) {
38 plot(
const plot& rhl): cydui::components::component_t<
plot>() {
40 top_axis = rhl.top_axis;
41 bottom_axis = rhl.bottom_axis;
42 left_axis = rhl.left_axis;
43 right_axis = rhl.right_axis;
47 series.set_ref(*
this);
54 double axis_title_size = 25;
56 double top_axis_h = component.top_axis.show_? 40: 0;
57 double bottom_axis_h = component.bottom_axis.show_? 40: 0;
58 double left_axis_w = component.left_axis.show_? 50: 0;
59 double right_axis_w = component.right_axis.show_? 50: 0;
61 if (top_axis_h > 0 && !component.top_axis.title_.empty()) {
62 top_axis_h += axis_title_size;
64 if (bottom_axis_h > 0 && !component.bottom_axis.title_.empty()) {
65 bottom_axis_h += axis_title_size;
67 if (left_axis_w > 0 && !component.left_axis.title_.empty()) {
68 left_axis_w += axis_title_size;
70 if (right_axis_w > 0 && !component.right_axis.title_.empty()) {
71 right_axis_w += axis_title_size;
74 std::vector<cydui::components::component_holder_t> result{};
76 result.emplace_back(component.grid.build_component(
79 $width - left_axis_w - right_axis_w,
80 $height - title_h - top_axis_h - bottom_axis_h
82 for (
auto& serie: component.series.build_component(
85 $width - left_axis_w - right_axis_w,
86 $height - title_h - top_axis_h - bottom_axis_h
88 result.emplace_back(serie);
91 result.emplace_back(component.top_axis.build_component(
94 $width - left_axis_w - right_axis_w,