Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Setting chart appearance from an external source?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Setting chart appearance from an external source?

 Post Reply Post Reply
Author
Message
wssdev View Drop Down
Groupie
Groupie


Joined: 04 May 2010
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote wssdev Quote  Post ReplyReply Direct Link To This Post Topic: Setting chart appearance from an external source?
    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...

Back to Top
wssdev View Drop Down
Groupie
Groupie


Joined: 04 May 2010
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote wssdev Quote  Post ReplyReply Direct Link To This Post Posted: 04 January 2012 at 10:45am
OK, found it in Samples\Chart\ChartBrowser\ChartFromFileView.cpp, CreateChart() method.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.