16#include "ROOT/RText.hxx"
17#include "ROOT/RLine.hxx"
24 auto canvas = RCanvas::Create(
"Use RStyle for line styling");
27 for (
int i = 10; i > 0; i--){
30 auto text = canvas->Add<RText>(
RPadPos{.3_normal, 1_normal*num}, std::to_string(i));
31 text->text.size = 0.04;
32 text->text.align = RAttrText::kRightCenter;
33 text->text.font = RAttrFont::kArialOblique;
35 auto line = canvas->Add<RLine>(
RPadPos(.32_normal,1_normal*num),
RPadPos(.8_normal, 1_normal*num));
36 line->SetId(std::string(
"obj") + std::to_string(i));
37 line->SetCssClass(std::string(
"user_class_") + std::to_string(i % 3));
40 auto style = std::make_shared<RStyle>();
42 style->AddBlock(
".user_class_1").AddInt(
"line_style", 4);
43 style->AddBlock(
".user_class_2").AddDouble(
"line_width", 5.);
44 style->AddBlock(
"#obj7").AddString(
"line_color",
"#0000FF");
46 style->AddBlock(
"line").AddString(
"line_color",
"red");
48 canvas->UseStyle(
style);
53 canvas->ClearOnClose(
style);
Option_t Option_t TPoint TPoint const char text
A position (horizontal and vertical) in a RPad.