| 826 | } |
| 827 | |
| 828 | ReturnCode plot_axes(Context* ctx, PlotConfig* plot, const Expr* expr) { |
| 829 | std::array<Measure, 4> margins = {from_em(1), from_em(1), from_em(1), from_em(1)}; |
| 830 | std::array<AxisDefinition, 4> axes; |
| 831 | |
| 832 | axes[0].scale = plot->scale_x; |
| 833 | axes[0].align = AxisAlign::TOP; |
| 834 | axes[0].label_attach = AxisLabelAttach::BOTTOM; |
| 835 | axes[0].title_offset = 1; |
| 836 | axes[0].tick_offset = -1; |
| 837 | axes[0].label_offset = 1; |
| 838 | axes[0].label_font = layer_get_font(ctx); |
| 839 | axes[0].label_font_size = layer_get_font_size(ctx); |
| 840 | axes[0].label_color = layer_get(ctx)->text_color; |
| 841 | axes[0].title_font = layer_get_font(ctx); |
| 842 | axes[0].title_font_size = layer_get_font_size(ctx); |
| 843 | axes[0].title_color = layer_get(ctx)->text_color; |
| 844 | axes[0].border_style.line_width = from_pt(1); |
| 845 | axes[0].border_style.color = layer_get(ctx)->foreground_color; |
| 846 | |
| 847 | axes[1].scale = plot->scale_y; |
| 848 | axes[1].align = AxisAlign::RIGHT; |
| 849 | axes[1].label_attach = AxisLabelAttach::LEFT; |
| 850 | axes[1].title_offset = 1; |
| 851 | axes[1].title_rotate = -90; |
| 852 | axes[1].tick_offset = -1; |
| 853 | axes[1].label_offset = 1; |
| 854 | axes[1].label_font = layer_get_font(ctx); |
| 855 | axes[1].label_font_size = layer_get_font_size(ctx); |
| 856 | axes[1].label_color = layer_get(ctx)->text_color; |
| 857 | axes[1].title_font = layer_get_font(ctx); |
| 858 | axes[1].title_font_size = layer_get_font_size(ctx); |
| 859 | axes[1].title_color = layer_get(ctx)->text_color; |
| 860 | axes[1].border_style.line_width = from_pt(1); |
| 861 | axes[1].border_style.color = layer_get(ctx)->foreground_color; |
| 862 | |
| 863 | axes[2].scale = plot->scale_x; |
| 864 | axes[2].align = AxisAlign::BOTTOM; |
| 865 | axes[2].label_attach = AxisLabelAttach::TOP; |
| 866 | axes[2].title_offset = -1; |
| 867 | axes[2].tick_offset = 1; |
| 868 | axes[2].label_offset = -1; |
| 869 | axes[2].label_font = layer_get_font(ctx); |
| 870 | axes[2].label_font_size = layer_get_font_size(ctx); |
| 871 | axes[2].label_color = layer_get(ctx)->text_color; |
| 872 | axes[2].title_font = layer_get_font(ctx); |
| 873 | axes[2].title_font_size = layer_get_font_size(ctx); |
| 874 | axes[2].title_color = layer_get(ctx)->text_color; |
| 875 | axes[2].border_style.line_width = from_pt(1); |
| 876 | axes[2].border_style.color = layer_get(ctx)->foreground_color; |
| 877 | |
| 878 | axes[3].scale = plot->scale_y; |
| 879 | axes[3].align = AxisAlign::LEFT; |
| 880 | axes[3].label_attach = AxisLabelAttach::RIGHT; |
| 881 | axes[3].title_offset = -1; |
| 882 | axes[3].title_rotate = -90; |
| 883 | axes[3].tick_offset = 1; |
| 884 | axes[3].label_offset = -1; |
| 885 | axes[3].label_font = layer_get_font(ctx); |
nothing calls this directly
no test coverage detected