Page 1 of 1

Enable Point Style in Graph on Specific Point

Posted: Wed Jun 17, 2009 3:26 pm
by 15046673
Hello,

I'm Working with Teechart and i need to do one thing.

I'm working with marks to post comments on my Graph, when the user click in one point i enable a TextBox and write some values to the mark, this thing is working OK.

But i want to enable a point style in that mark and not in the entire line...

i used this code but this enable the point in all line

document.getElementById("axChart").Series(0).asLine.Pointer.Visible = True

I Have the X and Y coordinates from the point, i wrote the mark on this:

document.getElementById("axChart").Canvas.TextOut X, Y , "Text"

Now i want to enable a POINT Style on this MArk, it's possible?

thanks

Thiago,

Re: Enable Point Style in Graph on Specific Point

Posted: Thu Jun 18, 2009 11:52 am
by yeray
Hi

Yes, you could activate the line's pointers and then use OnGetPointerStyle to hide or show the one you would like. Something like this:

Code: Select all

Private Sub Form_Load()
  TChart1.AddSeries scLine
  TChart1.Series(0).FillSampleValues 25
  
  TChart1.Series(0).asLine.Pointer.Visible = True
End Sub

Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
  If ValueIndex = 5 Then
    AStyle = psRectangle
  Else
    AStyle = psNothing
  End If
End Sub

Re: Enable Point Style in Graph on Specific Point

Posted: Thu Jun 18, 2009 2:16 pm
by 15046673
Hi, when i insert this code i having this error:

Code: Select all

        private sub axChart_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
          If ValueIndex = 5 Then
            AStyle = psRectangle
          Else
            AStyle = psNothing
          End If
        End Sub
Error: Expected ')'
Error: Object Expected

Re: Enable Point Style in Graph on Specific Point

Posted: Thu Jun 18, 2009 2:57 pm
by 15046673
Strange..

I used other sub to test and return the same error.

Without this code return no errors.

Code: Select all

Public Sub axChart_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
MsgBox SeriesIndex
End Sub
And there is another example with a sub, this is working OK

Code: Select all

		Private Sub axChart_OnMouseDown(ByVal Button, ByVal Shift, ByVal CordX, ByVal CordY)
	
			grf_X0 = CordX
			grf_Y0 = CordY
			
		End Sub

Here is my Object:

Code: Select all

  <object id="axChart" style="font-weight: 700; z-index: 101; left: 40px; float: left;
                                        width: 984px; top: 224px; height: 401px;" codebase="components/Teechart8.cab#version=8,0,0,1"                                       type="application/x-oleobject" border="1" classid="clsid:B6C10489-FB89-11D4-93C9-006008A7EED4"
                                        name="axChart" viewastext>
                                        <param name="Base64" value="VFBGMAtUQ2hhcnRDaGFydAAETGVmdAIAA1RvcAIABVdpZHRoA9gDBkhlaWdodAPCARFHcmFkaWVu&#13;&#10;dC5FbmRDb2xvcgT6+voAE0dyYWRpZW50LlN0YXJ0Q29sb3IE2+bwABBHcmFkaWVudC5WaXNpYmxl&#13;&#10;CQxNYXJnaW5Cb3R0b20CBQpNYXJnaW5MZWZ0AgELTWFyZ2luUmlnaHQCAQlNYXJnaW5Ub3ACAhFU&#13;&#10;aXRsZS5Gb250LkhlaWdodALwEFRpdGxlLkZvbnQuU3R5bGULBmZzQm9sZAASVGl0bGUuVGV4dC5T&#13;&#10;dHJpbmdzAQYKR3LhZmljbyBwSAAVQm90dG9tQXhpcy5BeGlzLldpZHRoAgEZQm90dG9tQXhpcy5E&#13;&#10;YXRlVGltZUZvcm1hdAYQZGQvTU0veXl5eSBISDptbRdCb3R0b21BeGlzLkdyaWQuVmlzaWJsZQga&#13;&#10;Qm90dG9tQXhpcy5MYWJlbHNNdWx0aUxpbmUJE0xlZnRBeGlzLkF4aXMuV2lkdGgCARBMZWdlbmQu&#13;&#10;QWxpZ25tZW50BwhsYUJvdHRvbRFMZWdlbmQuQ2hlY2tCb3hlcwkWTGVnZW5kLkZvbnRTZXJpZXND&#13;&#10;b2xvcgkSTGVnZW5kLkZyYW1lLkNvbG9yBwZjbEdyYXkZTGVnZW5kLkdyYWRpZW50LkRpcmVjdGlv&#13;&#10;bgcLZ2RUb3BCb3R0b20YTGVnZW5kLkdyYWRpZW50LkVuZENvbG9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GAVgNWFZhbHVlcy5PcmRlcgcGbG9Ob25lEFlWYWx1&#13;&#10;ZXMuRGF0ZVRpbWUIDFlWYWx1ZXMuTmFtZQYBWQ1ZVmFsdWVzLk9yZGVyBwZsb05vbmUAAA9URmFz&#13;&#10;dExpbmVTZXJpZXMHU2VyaWVzMgVEZXB0aAIAEU1hcmtzLkFycm93TGVuZ3RoAggWTWFya3MuR3Jh&#13;&#10;ZGllbnQuVmlzaWJsZQkQTWFya3MuU2hhcGVTdHlsZQcRZm9zUm91bmRSZWN0YW5nbGULTWFya3Mu&#13;&#10;U3R5bGUHCHNtc1ZhbHVlDU1hcmtzLlZpc2libGUIC1Nlcmllc0NvbG9yBwZjbEdyYXkFVGl0bGUG&#13;&#10;FXBIIGRhIMFndWEgUHV2aWFsIE1TRwtWYWx1ZUZvcm1hdAYJIy4jIzAsIyMjEUF1dG9TY2FsZVZl&#13;&#10;cnRBeGlzCA1MaW5lUGVuLkNvbG9yBwZjbEdyYXkQWFZhbHVlcy5EYXRlVGltZQkMWFZhbHVlcy5O&#13;&#10;YW1lBgFYDVhWYWx1ZXMuT3JkZXIHBmxvTm9uZRBZVmFsdWVzLkRhdGVUaW1lCAxZVmFsdWVzLk5h&#13;&#10;bWUGAVkNWVZhbHVlcy5PcmRlcgcGbG9Ob25lAAALVEN1cnNvclRvb2wAC0ZvbGxvd01vdXNlCQVT&#13;&#10;dHlsZQcLY3NzVmVydGljYWwAAA1UTWFya3NUaXBUb29sCkNoYXJ0VG9vbDALTW91c2VBY3Rpb24H&#13;&#10;CG10bUNsaWNrAAAAAAAAAAIAAAAA/////w==">
                                    </object>

Re: Enable Point Style in Graph on Specific Point

Posted: Fri Jun 19, 2009 4:28 pm
by Pep
Hello Lopes,

would you be so kind to let us know which environment and language ( vbscript, javascript, etc.. ) are you using ?

Re: Enable Point Style in Graph on Specific Point

Posted: Mon Jun 22, 2009 3:26 pm
by 15046673
vbscript!

regards,

Re: Enable Point Style in Graph on Specific Point

Posted: Tue Jun 23, 2009 4:33 pm
by Pep
Hi Lopes,

you could use the following code (tested here and works fine) :

Code: Select all

Sub TChart1_OnGetSeriesPointerStyle(SeriesIndex, ValueIndex, AStyle) 
if ValueIndex = 4 then ' Will change the next pointer 5 due to the vbscript
  TChart1.Series(0).asPoint.Pointer.Style = 1  ' circle
else
  TChart1.Series(0).asPoint.Pointer.Style = 0
end if
End Sub
Another way would be to draw your own symbols (or anything else) onto the TeeChart canvas using TeeChart's Canvas drawing methods (into the OnAfterDraw event) exposed in Tutorial 13 - Custom drawing on the Chart Panel.

Re: Enable Point Style in Graph on Specific Point

Posted: Thu Jul 02, 2009 2:05 pm
by 15046673
Alright PEP, the code worked (with no errors)

But nothing happened..

example:
i write a text in a Point:

Code: Select all

document.getElementById("axChart").Canvas.TextOut X, Y , "Text"
I want to enable to enable the point style circle on this point with X and Y coordinates.. is possible?

What means ValueIndex in this context?

Code: Select all

Sub TChart1_OnGetSeriesPointerStyle(SeriesIndex, ValueIndex, AStyle) 
I put this Sub on my application but doesn´t being called (i put a MsgBox do test) like this:

Code: Select all

Sub TChart1_OnGetSeriesPointerStyle(SeriesIndex, ValueIndex, AStyle) 
if ValueIndex = 4 then ' Will change the next pointer 5 due to the vbscript
MsgBox "Test"
  TChart1.Series(0).asPoint.Pointer.Style = 1  ' circle
else
  TChart1.Series(0).asPoint.Pointer.Style = 0
end if
End Sub

Re: Enable Point Style in Graph on Specific Point

Posted: Mon Jul 06, 2009 9:35 am
by Pep
Hi Lopes,

strange, here the event is called, could you please check if the attached example works fine for you ?