Print Page | Close Window

Setting chart appearance from an external source?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=19374
Printed Date: 19 May 2024 at 3:38pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Setting chart appearance from an external source?
Posted By: wssdev
Subject: Setting chart appearance from an external source?
Date 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...




Replies:
Posted By: wssdev
Date Posted: 04 January 2012 at 10:45am
OK, found it in Samples\Chart\ChartBrowser\ChartFromFileView.cpp, CreateChart() method.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net