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

Inherits Aspose::Slides::Charts::IChartData, and Aspose::Slides::IDOMObject.

Public Member Functions

System::SharedPtr< IChartDataWorkbookget_ChartDataWorkbook ()
 Gets the cells factory to create cells used for chart series or categories. Read-only IChartDataWorkbook. More...
 
System::SharedPtr< IChartSeriesCollectionget_Series ()
 Gets the series. Read-only IChartSeriesCollection. More...
 
System::SharedPtr< IChartSeriesGroupCollectionget_SeriesGroups ()
 Gets the groups of series. Read-only IChartSeriesGroupCollection. More...
 
System::SharedPtr< IChartCategoryCollectionget_Categories ()
 Gets the primary categories (or both primary and secondary categories if UseSecondaryCategories property is false). Read-only IChartCategoryCollection. More...
 
bool get_UseSecondaryCategories ()
 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...
 
void set_UseSecondaryCategories (bool value)
 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...
 
System::SharedPtr< IChartCategoryCollectionget_SecondaryCategories ()
 Gets the secondary categories if UseSecondaryCategories property is true. Read-only IChartCategoryCollection. More...
 
ChartDataSourceType get_DataSourceType ()
 Represents external workbook path if external data source, null otherwise More...
 
System::String get_ExternalWorkbookPath ()
 Represents data source of the chart More...
 
System::SharedPtr< IDOMObjectget_Parent_Immediate ()
 Returns Parent_Immediate object. Read-only IDOMObject. More...
 
System::SharedPtr< System::IO::MemoryStreamReadWorkbookStream ()
 Writes the internally contained Excel workbook it into an in-memory stream. More...
 
void WriteWorkbookStream (System::SharedPtr< System::IO::MemoryStream > ms)
 Initializes the internally contained Excel workbook with user-specified value. More...
 
void SetRange (System::String formula)
 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...
 
void SetExternalWorkbook (System::String workbookPath)
 Sets external workbook as a data source for the chart. Chart data will be updated from the target workbook. More...
 
void SetExternalWorkbook (System::String workbookPath, bool updateChartData)
 Sets external workbook as a data source for the chart. More...
 
void SwitchRowColumn ()
 Swap the data over the axis. Data being charted on the X axis will move to the Y axis and vice versa. 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)
 

Protected Member Functions

System::SharedPtr< Chartget_ChartInternal ()
 Returns the parent chart. Read-only IChart. More...
 
bool get_UseCache ()
 Determines data source for rendering (chart cache or workbook) More...
 
bool get_IsWorkbookLoaded ()
 Returns true if workbook is deserialized. More...
 
void set_IsWorkbookLoaded (bool value)
 Returns true if workbook is deserialized. More...
 
System::SharedPtr< System::IO::MemoryStreamget_EmbeddedWorkbookData ()
 Returns embedded workbook part. Returns null if embedded workbook is deserialized. More...
 
void set_EmbeddedWorkbookData (System::SharedPtr< System::IO::MemoryStream > value)
 Returns embedded workbook part. Returns null if embedded workbook is deserialized. More...
 
Aspose::Slides::XlsxSerialization::WorkbookType get_EmbeddedWorkbookType ()
 
void set_EmbeddedWorkbookType (Aspose::Slides::XlsxSerialization::WorkbookType value)
 
System::SharedPtr< IChartDataWorkbookInitWorkbookIfNeeded ()
 
 ChartData (System::SharedPtr< Chart > parentImmediate)
 
bool WriteWorkbookStreamAndCheckSheets (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< System::Collections::Generic::List< System::String >> namesToCheckResolve, System::SharedPtr< Aspose::Foundation::Blob::BlobManager > blobManager, System::SharedPtr< InterruptionToken > interruptionToken)
 Initializes the internally contained Excel workbook with user-specified value (if checking sheets by its names is successful) or with empty workbook. More...
 
void SetSeriesToPosition (int32_t index, System::SharedPtr< IChartSeries > series)
 
void ValidateDataCell (System::SharedPtr< IChartDataCell > cell)
 Checks if data cell belongs to chart's embedded workbook. Otherwise exception will be thrown. More...
 

Static Protected Member Functions

static System::String NormalizeExternalWorkbookPath (System::String url)
 

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.

Constructor & Destructor Documentation

◆ ChartData()

Aspose::Slides::Charts::ChartData::ChartData ( System::SharedPtr< Chart parentImmediate)
protected

Member Function Documentation

◆ get_Categories()

System::SharedPtr<IChartCategoryCollection> Aspose::Slides::Charts::ChartData::get_Categories ( )
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()
}

Implements Aspose::Slides::Charts::IChartData.

◆ get_ChartDataWorkbook()

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

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

Implements Aspose::Slides::Charts::IChartData.

◆ get_ChartInternal()

System::SharedPtr<Chart> Aspose::Slides::Charts::ChartData::get_ChartInternal ( )
protected

Returns the parent chart. Read-only IChart.

◆ get_DataSourceType()

ChartDataSourceType Aspose::Slides::Charts::ChartData::get_DataSourceType ( )
virtual

Represents external workbook path if external data source, null otherwise

Implements Aspose::Slides::Charts::IChartData.

◆ get_EmbeddedWorkbookData()

System::SharedPtr<System::IO::MemoryStream> Aspose::Slides::Charts::ChartData::get_EmbeddedWorkbookData ( )
protected

Returns embedded workbook part. Returns null if embedded workbook is deserialized.

◆ get_EmbeddedWorkbookType()

Aspose::Slides::XlsxSerialization::WorkbookType Aspose::Slides::Charts::ChartData::get_EmbeddedWorkbookType ( )
protected

◆ get_ExternalWorkbookPath()

System::String Aspose::Slides::Charts::ChartData::get_ExternalWorkbookPath ( )
virtual

Represents data source of the chart

Implements Aspose::Slides::Charts::IChartData.

◆ get_IsWorkbookLoaded()

bool Aspose::Slides::Charts::ChartData::get_IsWorkbookLoaded ( )
protected

Returns true if workbook is deserialized.

◆ get_Parent_Immediate()

System::SharedPtr<IDOMObject> Aspose::Slides::Charts::ChartData::get_Parent_Immediate ( )
virtual

Returns Parent_Immediate object. Read-only IDOMObject.

Implements Aspose::Slides::IDOMObject.

◆ get_SecondaryCategories()

System::SharedPtr<IChartCategoryCollection> Aspose::Slides::Charts::ChartData::get_SecondaryCategories ( )
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()
}

Implements Aspose::Slides::Charts::IChartData.

◆ get_Series()

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

Gets the series. Read-only IChartSeriesCollection.

Implements Aspose::Slides::Charts::IChartData.

◆ get_SeriesGroups()

System::SharedPtr<IChartSeriesGroupCollection> Aspose::Slides::Charts::ChartData::get_SeriesGroups ( )
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.

Implements Aspose::Slides::Charts::IChartData.

◆ get_UseCache()

bool Aspose::Slides::Charts::ChartData::get_UseCache ( )
protected

Determines data source for rendering (chart cache or workbook)

◆ get_UseSecondaryCategories()

bool Aspose::Slides::Charts::ChartData::get_UseSecondaryCategories ( )
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.

Implements Aspose::Slides::Charts::IChartData.

◆ InitWorkbookIfNeeded()

System::SharedPtr<IChartDataWorkbook> Aspose::Slides::Charts::ChartData::InitWorkbookIfNeeded ( )
protected

◆ NormalizeExternalWorkbookPath()

static System::String Aspose::Slides::Charts::ChartData::NormalizeExternalWorkbookPath ( System::String  url)
staticprotected

◆ ReadWorkbookStream()

System::SharedPtr<System::IO::MemoryStream> Aspose::Slides::Charts::ChartData::ReadWorkbookStream ( )
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.

Implements Aspose::Slides::Charts::IChartData.

◆ set_EmbeddedWorkbookData()

void Aspose::Slides::Charts::ChartData::set_EmbeddedWorkbookData ( System::SharedPtr< System::IO::MemoryStream value)
protected

Returns embedded workbook part. Returns null if embedded workbook is deserialized.

◆ set_EmbeddedWorkbookType()

void Aspose::Slides::Charts::ChartData::set_EmbeddedWorkbookType ( Aspose::Slides::XlsxSerialization::WorkbookType  value)
protected

◆ set_IsWorkbookLoaded()

void Aspose::Slides::Charts::ChartData::set_IsWorkbookLoaded ( bool  value)
protected

Returns true if workbook is deserialized.

◆ set_UseSecondaryCategories()

void Aspose::Slides::Charts::ChartData::set_UseSecondaryCategories ( bool  value)
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.

Implements Aspose::Slides::Charts::IChartData.

◆ SetExternalWorkbook() [1/2]

void Aspose::Slides::Charts::ChartData::SetExternalWorkbook ( System::String  workbookPath)
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");

Implements Aspose::Slides::Charts::IChartData.

◆ SetExternalWorkbook() [2/2]

void Aspose::Slides::Charts::ChartData::SetExternalWorkbook ( System::String  workbookPath,
bool  updateChartData 
)
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);

Implements Aspose::Slides::Charts::IChartData.

◆ SetRange()

void Aspose::Slides::Charts::ChartData::SetRange ( System::String  formula)
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
ArgumentNullExceptionformula is null.
ArgumentExceptionformula has incorrect format.

Implements Aspose::Slides::Charts::IChartData.

◆ SetSeriesToPosition()

void Aspose::Slides::Charts::ChartData::SetSeriesToPosition ( int32_t  index,
System::SharedPtr< IChartSeries series 
)
protected

◆ SwitchRowColumn()

void Aspose::Slides::Charts::ChartData::SwitchRowColumn ( )
virtual

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

Implements Aspose::Slides::Charts::IChartData.

◆ ValidateDataCell()

void Aspose::Slides::Charts::ChartData::ValidateDataCell ( System::SharedPtr< IChartDataCell cell)
protected

Checks if data cell belongs to chart's embedded workbook. Otherwise exception will be thrown.

◆ WriteWorkbookStream()

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

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

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

Implements Aspose::Slides::Charts::IChartData.

◆ WriteWorkbookStreamAndCheckSheets()

bool Aspose::Slides::Charts::ChartData::WriteWorkbookStreamAndCheckSheets ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< System::Collections::Generic::List< System::String >>  namesToCheckResolve,
System::SharedPtr< Aspose::Foundation::Blob::BlobManager >  blobManager,
System::SharedPtr< InterruptionToken interruptionToken 
)
protected

Initializes the internally contained Excel workbook with user-specified value (if checking sheets by its names is successful) or with empty workbook.

Parameters
streamThe user-supplied stream containing the entire Excel workbook.
namesToCheckResolveList of names whitch Excel workbook must can resolve.
blobManagerBlobManager instance to manage large resources related to this workbook, like worksheets.
interruptionTokenThe token to monitor for interruption requests.
Returns
Return true if "ms" stream is not null and Excel workbook can resolve all names in namesToCheckResolve list. Return false otherwise and initialize the internally contained Excel workbook with empty workbook.