Setting chart appearance from an external source? |
Post Reply |
Author | |
wssdev
Groupie Joined: 04 May 2010 Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 03 January 2012 at 4:20am |
[XTP 15.1.3]
Hi, Am I missing something or there is no way to do chart appearance serialization to a string and back? CXTPChartAppearance::LoadAppearance() seems to be accepting only a resource ID, implying that the appearance data must be a resource. Internally, CXTPChartAppearance::LoadFromResource delegates the actual deserialization work to CXTPPropExchangeXMLNode. CXTPPropExchangeXMLNode itself does have a number of LoadXXX methods so apparently it can load content from a string or a file. Unfortunately, these methods are not exposed through CXTPChartAppearance anyhow. I was thinking about deriving from CXTPChartAppearance and re-implementing LoadAppearance so that it calls CXTPPropExchangeXMLNode::LoadFromString instead of CXTPPropExchangeXMLNode::LoadFromResource. However, that would not be enough. Even if I had my derived instance, CXTPChartContent would not allow me to set that instance on it. I would then need to go through the hassle of deriving from CXTPChartContent too, only to be able to inject my own appearance. Is there a simpler way to achieve serialization/deserialization to a string? Thanks in advance. [Update] I just realized that deriving won't work, LoadFromResource is not virtual. Besides, hijacking LoadFromResource to load from an external string would already be a hack... ▼ ▲ ▼ ▲ |
|
wssdev
Groupie Joined: 04 May 2010 Status: Offline Points: 19 |
Post Options
Thanks(0)
|
OK, found it in Samples\Chart\ChartBrowser\ChartFromFileView.cpp, CreateChart() method.
▼ ▲ |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |