Aspose::Words::Drawing::Charts::ChartAxisTitle class

ChartAxisTitle class

Provides access to the axis title properties. To learn more, visit the Working with Charts documentation article.

class ChartAxisTitle : public System::Object

Methods

MethodDescription
get_Font()Provides access to the font formatting of the axis title.
get_Format()Provides access to fill and line formatting of the axis title.
get_Overlay()Determines whether other chart elements shall be allowed to overlap the title. The default value is false.
get_Show()Determines whether the title shall be shown for the axis. The default value is false.
get_Text()Gets or sets the text of the axis title. If null or empty value is specified, auto generated title will be shown.
GetType() const override
Is(const System::TypeInfo&) const override
set_Overlay(bool)Setter for Aspose::Words::Drawing::Charts::ChartAxisTitle::get_Overlay.
set_Show(bool)Setter for Aspose::Words::Drawing::Charts::ChartAxisTitle::get_Show.
set_Text(const System::String&)Setter for Aspose::Words::Drawing::Charts::ChartAxisTitle::get_Text.
static Type()

Examples

Shows how to set chart axis title.

auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);

System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertChart(Aspose::Words::Drawing::Charts::ChartType::Column, 432, 252);

System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeriesCollection> seriesColl = chart->get_Series();
// Delete default generated series.
seriesColl->Clear();

seriesColl->Add(u"AW Series 1", System::MakeArray<System::String>({u"AW Category 1", u"AW Category 2"}), System::MakeArray<double>({1, 2}));

System::SharedPtr<Aspose::Words::Drawing::Charts::ChartAxisTitle> chartAxisXTitle = chart->get_AxisX()->get_Title();
chartAxisXTitle->set_Text(u"Categories");
chartAxisXTitle->set_Show(true);
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartAxisTitle> chartAxisYTitle = chart->get_AxisY()->get_Title();
chartAxisYTitle->set_Text(u"Values");
chartAxisYTitle->set_Show(true);
chartAxisYTitle->set_Overlay(true);
chartAxisYTitle->get_Font()->set_Size(12);
chartAxisYTitle->get_Font()->set_Color(System::Drawing::Color::get_Blue());

doc->Save(get_ArtifactsDir() + u"Charts.ChartAxisTitle.docx");

See Also