Page 1 of 1

Problems with AxTeeCommander

Posted: Fri Mar 03, 2006 8:38 am
by 9527514
Hello,

could you please explain how to add the AxTeeCommander to a project?

The demo says:

Private Sub Form_Load()
TeeCommander1.Chart = TChart1
End Sub

Changing this into

AxTeeCommander1.chart = AxTChart1

works - except that the whole commandbar isn't accessible. Not accessible means that it is drawn, but greyed out.


Next question:
Demo also says for custom commander:

Private Sub Form_Load()
TeeCommander1.Chart = TChart1
TeeCommander1.Controls = Array(tcbRotate, _
tcbSeparator, _
tcbZoom, _
tcbSeparator, _
tcbEdit)
End Sub

The ".controls = Array(tcbRotate, ... )" command doesn't work with AxTeeCommander, how can I solve this problem? First I thougt that it may could be the AddRange method, but I can't get it to work neither

Any advice on this?

Regards,
Mark

Posted: Wed Mar 08, 2006 11:00 am
by Pep
Hi Mark,
could you please explain how to add the AxTeeCommander to a project?
if you're using the AcitveX version with VS.Net should work using :

Code: Select all

axTeeCommander1.ChartLink = axTChart1.ChartLink;
The ".controls = Array(tcbRotate, ... )" command doesn't work with AxTeeCommander, how can I solve this problem? First I thougt that it may could be the AddRange method, but I can't get it to work neither
You should use :
int[] customButtons=new int[3];

customButtons[0]=(int)TeeChart.ETeeCommanderControls.tcbEdit;
customButtons[1]=(int)TeeChart.ETeeCommanderControls.tcbRotate;
customButtons[2]=(int)TeeChart.ETeeCommanderControls.tcbMove;

axTeeCommander1.Buttons=customButtons;

Posted: Wed Mar 08, 2006 11:26 am
by 9527514
Thanks a lot,

this works! But, now that we've implemented the AxTeeCommander it seems that the onClickSeries Method doesn't seem to work any more!?

Posted: Mon Mar 13, 2006 11:46 am
by 9527514
Hello,

the problem still exists. After reconfiguring a chart with the AxTeeCommander the onClickSeries Event doesn't seem to work. Is this a known bug?

Mark

/edit: ok, the problem exists if you set the values on your own, too. Is there any way to avoid this behavior?
It seems that there are 2 settings which cause the event not to work, these are opengl and the orthogonal setting.

Posted: Tue Mar 14, 2006 4:56 pm
by Pep
Hi,
the problem still exists. After reconfiguring a chart with the AxTeeCommander the onClickSeries Event doesn't seem to work. Is this a known bug?
It works fine here , without using OpenGL. Does it works fine for you ?
/edit: ok, the problem exists if you set the values on your own, too. Is there any way to avoid this behavior?
It seems that there are 2 settings which cause the event not to work, these are opengl and the orthogonal setting.
Setting OpenGL to true makes the OnClickSeries event to not work, this is by default (missing feature).

Posted: Wed Mar 15, 2006 7:42 am
by 9527514
Hi Pep,

thank you for the answer.
It works fine here , without using OpenGL. Does it works fine for you ?
No it doesn't :? See below

Setting OpenGL to true makes the OnClickSeries event to not work, this is by default (missing feature).
Ok, good to know (I already thought so). But it neither works when changing the settings via the AxTeeCommander, nor when we use the orthogonal value instead.


Here's a short sample code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim x As Integer

For x = 1 To 5
AxTChart1.CloneSeries(0)
Next x

AxTeeCommander1.ChartLink = AxTChart1.ChartLink

Call Wasserfall_Darstellung()
End Sub

Private Sub AxTChart1_OnClickSeries(ByVal sender As Object, ByVal e As AxTeeChart.ITChartEvents_OnClickSeriesEvent) Handles AxTChart1.OnClickSeries
MsgBox("click")
End Sub

Private Sub Wasserfall_Darstellung()
Dim x As Integer

For x = 0 To 4
AxTChart1.Series(x).asFastLine.DrawAllPoints = True
AxTChart1.Series(x).FillSampleValues(20)
Next

With AxTChart1.Aspect
.Chart3DPercent = 56
.Zoom = 85
.Rotation = 335
.Perspective = 33
.HorizOffset = 32
.VertOffset = 5
'.Orthogonal = False

End With
End Sub

After making changes with the commander, the onClickSeries event doesn't work any more. To avoid this I tried to set the values myself, but if you use ".Orthogonal = False" - which is necessary imho - it doesn't work either.

Posted: Thu Mar 16, 2006 10:05 am
by Pep
Hi,

Yes, you're correct. For some extreme 3D parameters the internal 3d->2d->3d transformation is not fully correct and you end up with wrong results (Series clicked is not found). For in most cases the Clicked method returns correct index even if chart is in 3d.

Posted: Thu Mar 16, 2006 10:27 am
by 9527514
OK, thanks for the confirmation, very bad to hear that :(

So, now we have to find another way to solve this problem. After some research i stepped on the onClickLegend Event, but - as always - the example code provided doesn't work with VB and AxTChart :)

Could you be so kind and help me out with this?

I've found AxTChart1.Series(0).LegendToValueIndex(0), is this the right way?


Best regards,
Mark

Posted: Fri Mar 17, 2006 10:39 am
by Pep
Hi Mark,
So, now we have to find another way to solve this problem. After some research i stepped on the onClickLegend Event, but - as always - the example code provided doesn't work with VB and AxTChart
Sorry, most of the demos provided in the ActiveX version has been created with VB, VC++, etc.. But these can be translated.
Could you be so kind and help me out with this?
Yes, of course.
I've found AxTChart1.Series(0).LegendToValueIndex(0), is this the right way?
Yes, you could use similar code like the following example (VB code), but in the OnClickLegend event. If you need help to translate it please let us know.

Code: Select all

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim tmp, tmpL As Integer
With TChart1
  If .Series(0).Clicked(X, Y) <> -1 And OnSeriesPoint = False Then
   .Canvas.Brush.Style = bsSolid
   .Canvas.Pen.Color = vbBlack
   .Canvas.Brush.Color = vbWhite
    .Canvas.TextOut X + 10, Y, TChart1.Axis.Bottom.Labels.FormattedValue(.Series(0).XScreenToValue(X)) _
                             & ", " & Str$(TChart1.Axis.Left.Labels.FormattedValue(.Series(0).YScreenToValue(Y)))

   OnSeriesPoint = True
  End If
  'Repaint Chart to clear Textoutputted Mark
  If .Series(0).Clicked(X, Y) = -1 And OnSeriesPoint = True Then
    OnSeriesPoint = False
    .Repaint
  End If
  
  tmpL = TChart1.Legend.Clicked(X, Y)
  If tmpL <> -1 And ((tmpL <> tmpL2) Or (OnLegendPoint = False)) Then
     .Repaint
     .Canvas.Brush.Color = .Series(0).LegendItemColor(tmpL)
     .Canvas.Rectangle X, Y, X + 20, Y + 20
     .Canvas.Brush.Color = vbWhite
     .Canvas.TextOut X + 7, Y + 7, Str$(.Series(0).YValues.Value(.Series(0).LegendToValueIndex(tmpL))) & " "
     tmpL2 = tmpL
    OnLegendPoint = True
    
  End If
  
  If .Legend.Clicked(X, Y) = -1 And OnLegendPoint = True Then
    OnLegendPoint = False
    .Repaint
  End If
End With

I've found AxTChart1.Series(0).LegendToValueIndex(0), is this the right way?