Aspose::Words::Drawing::Charts::ChartAxisCollection class

ChartAxisCollection class

Represents a collection of chart axes.

class ChartAxisCollection : public System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Words::Drawing::Charts::ChartAxis>>

Methods

MethodDescription
get_Count()Gets the number of axes in this collection.
GetEnumerator() overrideReturns an enumerator object.
GetType() const override
idx_get(int32_t)Gets the axis at the specified index.
Is(const System::TypeInfo&) const override
static Type()

Examples

Shows how to work with axes collection.

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, 500, 300);
System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();

// Hide the major grid lines on the primary and secondary Y axes.
for (auto&& axis : System::IterateOver(chart->get_Axes()))
{
    if (axis->get_Type() == Aspose::Words::Drawing::Charts::ChartAxisType::Value)
    {
        axis->set_HasMajorGridlines(false);
    }
}

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

See Also