Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tick Ruler to Match Series Elements in MSChart
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01185238
Message ID:
01185387
Views:
13
Hi Terry,

The TwipsToChartPart() method always returns NULL. All the info is returned in the OUTPUT parameters. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbmthtwipstochartpartmethod.asp
In VFP call should look like code below (not tested). I provided the VtChPart... constants but you can get them using Object Browser
#DEFINE VtChPartTypeChart	0	&& Part type - chart
#DEFINE VtChPartTypeTitle	1	&& Part type - title
#DEFINE VtChPartTypeFootnote	2	&& Part type - footnote
#DEFINE VtChPartTypeLegend	3	&& Part type - legend
#DEFINE VtChPartTypePlot	4	&& Part type - plot
#DEFINE VtChPartTypeSeries	5	&& Part type - series
#DEFINE VtChPartTypeSeriesLabel	6	&& Part type - series label
#DEFINE VtChPartTypePoint	7	&& Part type - point
#DEFINE VtChPartTypePointLabel	8	&& Part type - point label
#DEFINE VtChPartTypeAxis	9	&& Part type - axis
#DEFINE VtChPartTypeAxisLabel	10	&& Part type - axislabel
#DEFINE VtChPartTypeAxisTitle	11	&& Part type - axistitle
#DEFINE VtChPartTypeSeriesName	12	&& Part type - series name
#DEFINE VtChPartTypePointName	13	&& Part type - point name
#DEFINE VtChPartTypeCount	14	&& Number of elements in this enumeration

object.TwipsToChartPart(nX, nY, @iPart, @iIndex1, @iIndex2, @iIndex3, @iIndex4)
DO CASE
CASE WHEN iPart = VtChPartTypeChart 
  ...
ENDCASE
>In MSChart, there is a function called TwipsToChartPart. The ruler has been solved. But the TwipsToChartPart is killing me. My expectation was that it would behave as "Hittest" does in Treeview or Listview), and that a mousemove "across" a series datapoint
>
>The VB "blogs" indicate some are having success - the TwipsToChartPart (TTCP) function reads as:
>
TwipsToChartPart(x, y, iPart, iIndex1, iIndex2, iIndex3, iIndex4)
>
>The VB guys seem to be saying that VB returns the value of iPart, a ChartPartType (series, datapoing, axis, etc). Inside VFP 9, TTCP fires without error for the literal values:
>TwipsToChartPart( nX,nY,.f.,.f.,.f.,.f.)
>
>When the pointer moves over a data point - the value is echoed to the form caption:
.caption=transform(TwipsToChartPart(x, y, iPart, iIndex1, iIndex2, iIndex3, iIndex4)
>
>It's always null. Even hard setting the part to the "datapoint" constant (7), returns a null.
>
>I have not figured out a way to determine what methods an OCX "really" exposes to VFP - and again - no one has done this to either report a failure or success using VFP.
>
>I emailed Hisa's Blog - maybe he can give me a more definate answer. Maybe an API wrapper could solve it - dunno.
>
<snip>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform