Aspose::Slides::Charts::IChartData Class Referenceabstract

Represents data used for a chart plotting. More...

Inherits System::Object.

Inherited by Aspose::Slides::Charts::ChartData.

Public Member Functions

virtual System::SharedPtr< IChartDataWorkbookget_ChartDataWorkbook ()=0
 Gets the cells factory to create cells used for chart series or categories. Read-only IChartDataWorkbook. More...
 
virtual System::SharedPtr< IChartSeriesCollectionget_Series ()=0
 Gets the series. Read-only IChartSeriesCollection. More...
 
virtual System::SharedPtr< IChartSeriesGroupCollectionget_SeriesGroups ()=0
 Gets the groups of series. Read-only IChartSeriesGroupCollection. More...
 
virtual System::SharedPtr< IChartCategoryCollectionget_Categories ()=0
 Gets the primary categories (or both primary and secondary categories if UseSecondaryCategories property is false). Read-only IChartCategoryCollection. More...
 
virtual bool get_UseSecondaryCategories ()=0
 If false then SecondaryCategories property return null and data in Categories property is used both for primary and secondary series. If true then data in SecondaryCategories property is used for secondary series and data in Categories property is used for primary series. Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}
Read bool. More...
 
virtual void set_UseSecondaryCategories (bool value)=0
 If false then SecondaryCategories property return null and data in Categories property is used both for primary and secondary series. If true then data in SecondaryCategories property is used for secondary series and data in Categories property is used for primary series. Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}
Write bool. More...
 
virtual System::SharedPtr< IChartCategoryCollectionget_SecondaryCategories ()=0
 Gets the secondary categories if UseSecondaryCategories property is true. Read-only IChartCategoryCollection. More...
 
virtual ChartDataSourceType get_DataSourceType ()=0
 Represents data source of the chart More...
 
virtual System::String get_ExternalWorkbookPath ()=0
 Represents external workbook path if data source is external, null otherwise More...
 
virtual System::SharedPtr< System::IO::MemoryStreamReadWorkbookStream ()=0
 Writes the internally contained Excel workbook it into an in-memory stream. More...
 
virtual void WriteWorkbookStream (System::SharedPtr< System::IO::MemoryStream > ms)=0
 Initializes the internally contained Excel workbook with user-specified value. More...
 
virtual void SetRange (System::String formula)=0
 Set chart data range. Series and categories will be updated based on new data range. If amount of series in data range greater than count of series in the chart data then additional series with the same type as a last series in the current collection will be added to the end of the collection. More...
 
virtual void SwitchRowColumn ()=0
 Swap the data over the axis. Data being charted on the X axis will move to the Y axis and vice versa. More...
 
virtual void SetExternalWorkbook (System::String workbookPath)=0
 Sets external workbook as a data source for the chart. Chart data will be updated from the target workbook. More...
 
virtual void SetExternalWorkbook (System::String workbookPath, bool updateChartData)=0
 Sets external workbook as a data source for the chart. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Represents data used for a chart plotting.

Member Function Documentation

◆ get_Categories()

virtual System::SharedPtr<IChartCategoryCollection> Aspose::Slides::Charts::IChartData::get_Categories ( )
pure virtual

Gets the primary categories (or both primary and secondary categories if UseSecondaryCategories property is false). Read-only IChartCategoryCollection.

If UseSecondaryCategories property is false then SecondaryCategories property return null and data in this Categories property is used both for primary and secondary series. If UseSecondaryCategories property is true then data in SecondaryCategories property is used for secondary series and data in this Categories property is used for primary series.

Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_ChartDataWorkbook()

virtual System::SharedPtr<IChartDataWorkbook> Aspose::Slides::Charts::IChartData::get_ChartDataWorkbook ( )
pure virtual

Gets the cells factory to create cells used for chart series or categories. Read-only IChartDataWorkbook.

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_DataSourceType()

virtual ChartDataSourceType Aspose::Slides::Charts::IChartData::get_DataSourceType ( )
pure virtual

Represents data source of the chart

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_ExternalWorkbookPath()

virtual System::String Aspose::Slides::Charts::IChartData::get_ExternalWorkbookPath ( )
pure virtual

Represents external workbook path if data source is external, null otherwise

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_SecondaryCategories()

virtual System::SharedPtr<IChartCategoryCollection> Aspose::Slides::Charts::IChartData::get_SecondaryCategories ( )
pure virtual

Gets the secondary categories if UseSecondaryCategories property is true. Read-only IChartCategoryCollection.

If UseSecondaryCategories property is false then this SecondaryCategories property return null and data in Categories property is used both for primary and secondary series. If UseSecondaryCategories property is true then data in this SecondaryCategories property is used for secondary series and data in Categories property is used for primary series.

Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_Series()

virtual System::SharedPtr<IChartSeriesCollection> Aspose::Slides::Charts::IChartData::get_Series ( )
pure virtual

Gets the series. Read-only IChartSeriesCollection.

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_SeriesGroups()

virtual System::SharedPtr<IChartSeriesGroupCollection> Aspose::Slides::Charts::IChartData::get_SeriesGroups ( )
pure virtual

Gets the groups of series. Read-only IChartSeriesGroupCollection.

1) Each group of series contains series with combinable types. Groups of combinable series types defined and described with CombinableSeriesTypesGroup enum. Also each group of series contains series witch is plotted whether on primary axes or on secondary axes (not both cases in one group). So, principle of series grouping is a grouping by type groups mentioned above and by primary/secondary plotting type.

2) Group of series contains some series properies whitch is common for each series in group ("series group properties"). "Series group properties" in ChartSeriesGroup class is read/write. Each of "series group properties" can have a read-only projection in ChartSeries class.

Implemented in Aspose::Slides::Charts::ChartData.

◆ get_UseSecondaryCategories()

virtual bool Aspose::Slides::Charts::IChartData::get_UseSecondaryCategories ( )
pure virtual

If false then SecondaryCategories property return null and data in Categories property is used both for primary and secondary series. If true then data in SecondaryCategories property is used for secondary series and data in Categories property is used for primary series. Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}
Read bool.

Implemented in Aspose::Slides::Charts::ChartData.

◆ ReadWorkbookStream()

virtual System::SharedPtr<System::IO::MemoryStream> Aspose::Slides::Charts::IChartData::ReadWorkbookStream ( )
pure virtual

Writes the internally contained Excel workbook it into an in-memory stream.

Returns
Returns an instance of MemoryStream containing a copy of the internally contained Excel workbook.

Implemented in Aspose::Slides::Charts::ChartData.

◆ set_UseSecondaryCategories()

virtual void Aspose::Slides::Charts::IChartData::set_UseSecondaryCategories ( bool  value)
pure virtual

If false then SecondaryCategories property return null and data in Categories property is used both for primary and secondary series. If true then data in SecondaryCategories property is used for secondary series and data in Categories property is used for primary series. Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series->get_PlotOnSecondAxis() && series->get_Chart()->get_ChartData()->get_UseSecondaryCategories())
{
// related categories are series->get_Chart()->get_ChartData()->get_SecondaryCategories()
}
else
{
// related categories are series->get_Chart()->get_ChartData()->get_Categories()
}
Write bool.

Implemented in Aspose::Slides::Charts::ChartData.

◆ SetExternalWorkbook() [1/2]

virtual void Aspose::Slides::Charts::IChartData::SetExternalWorkbook ( System::String  workbookPath)
pure virtual

Sets external workbook as a data source for the chart. Chart data will be updated from the target workbook.

Parameters
workbookPathPath to the target workbook
Exceptions
InvalidOperationExceptionExternal workbook is not available or can't be loaded.
auto pres = System::MakeObject<Presentation>();
auto chart = pres->get_Slides()->idx_get(0)->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::Pie, 50.0f, 50.0f, 400.0f, 600.0f, true);
auto chartData = chart->get_ChartData();
(System::DynamicCast_noexcept<Aspose::Slides::Charts::ChartData>(chartData))->SetExternalWorkbook(u"../../workbook.xlsx");

Implemented in Aspose::Slides::Charts::ChartData.

◆ SetExternalWorkbook() [2/2]

virtual void Aspose::Slides::Charts::IChartData::SetExternalWorkbook ( System::String  workbookPath,
bool  updateChartData 
)
pure virtual

Sets external workbook as a data source for the chart.

Parameters
workbookPathPath to the target workbook
updateChartDataIf value is false only workbook path will be updated. Chart data won't be loaded and updated from the target workbook. Can be used when target workbook doesn't exist or it's not available. If value is true chart data will be updated from the target workbook.
Exceptions
InvalidOperationExceptionExternal workbook is not available or can't be loaded.
auto pres = System::MakeObject<Presentation>();
auto chart = pres->get_Slides()->idx_get(0)->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::Pie, 50.0f, 50.0f, 400.0f, 600.0f, true);
auto chartData = chart->get_ChartData();
(System::DynamicCast_noexcept<Aspose::Slides::Charts::ChartData>(chartData))->SetExternalWorkbook(u"http://path/doesnt/exists", false);

Implemented in Aspose::Slides::Charts::ChartData.

◆ SetRange()

virtual void Aspose::Slides::Charts::IChartData::SetRange ( System::String  formula)
pure virtual

Set chart data range. Series and categories will be updated based on new data range. If amount of series in data range greater than count of series in the chart data then additional series with the same type as a last series in the current collection will be added to the end of the collection.

Parameters
formulaThe cells data range formula. E.g: "Sheet1!$A$1:$C$4" , "SomeSheetName!A1:B100", "Sheet1!$A$1:$B$5;Sheet1!$D$1:$D$5".
Exceptions
System::ArgumentNullExceptionformula is null.
System::ArgumentExceptionformula has incorrect format.

Implemented in Aspose::Slides::Charts::ChartData.

◆ SwitchRowColumn()

virtual void Aspose::Slides::Charts::IChartData::SwitchRowColumn ( )
pure virtual

Swap the data over the axis. Data being charted on the X axis will move to the Y axis and vice versa.

Implemented in Aspose::Slides::Charts::ChartData.

◆ WriteWorkbookStream()

virtual void Aspose::Slides::Charts::IChartData::WriteWorkbookStream ( System::SharedPtr< System::IO::MemoryStream ms)
pure virtual

Initializes the internally contained Excel workbook with user-specified value.

Parameters
msThe user-supplied stream containing the entire Excel workbook.

Implemented in Aspose::Slides::Charts::ChartData.