voostone Posted August 2, 2009 Report Share Posted August 2, 2009 with the tips i know the width of bar BarWidth = ((((ChartWidth - LeftGap - RightGap)/NumberOfPoints)/NumberOfSeries)*Volume)/100 Now how can i know the width of the label 1,2,3 or the coordinate of label 4 Thanks. Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 5, 2009 Report Share Posted August 5, 2009 You are looking for the ValueToPixel method. Take a look at your documentation. Quote Link to comment Share on other sites More sharing options...
voostone Posted August 6, 2009 Author Report Share Posted August 6, 2009 when i used the method ValueToPixel but x,y always return 0. ValueToPixel(Xvalue, Yvalue, x, y, nYAxis) Yvalue = ChartName.Series(SeriesIndex).Yvalue(PointIndex) But how can I know the Xvalue?? thanks Quote Link to comment Share on other sites More sharing options...
voostone Posted August 6, 2009 Author Report Share Posted August 6, 2009 I download a demo VB source. It works without problem. When I transfer the function in the file of cfxocx.bas into PB(powerbuilder). It doesn't work correctly. Function CHART_LOWORD(ByVal l As Long) l = l And &HFFFF& If (l > 32767) Then 'why it's 32767? In PB the value is very big.. l = l - 65536 End If CHART_LOWORD = CInt(l) End Function Thank you very much! Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 6, 2009 Report Share Posted August 6, 2009 That method needs to be called after the whole chart has been calculated. Call it after you are done configuring the chart, call the RecalcScale method and try again. Quote Link to comment Share on other sites More sharing options...
voostone Posted August 6, 2009 Author Report Share Posted August 6, 2009 Function CHART_ML(ByVal wLow As Integer, ByVal wHi As Integer) CHART_ML = CLng(&H10000 * wHi) + wLow End Function (&H10000 * wHi) = 65536 * wHi ??? Quote Link to comment Share on other sites More sharing options...
voostone Posted August 6, 2009 Author Report Share Posted August 6, 2009 I called the RecalcScale method, but the result is 0. Ll_iy =chart.object.Series(0).Yvalue(1) //Ll_iy equals the value of the chart chart.object.ValueToPixel(Xvalue, Ll_iy, Ll_rx, Ll_ry, 0) the method i called is correct?? i don't know the Xvalue..So i try 0, 1, 200 and so on.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.