Page 1 of 1

Addxy Label is messing up the gridlines

Posted: Fri Mar 30, 2007 9:01 am
by 9530384
Hello support staff!

Our teechart is filled using the addxy command, using a custom axis for each series (basically one custom axis horizontal which is assigned to each series).

We have the following problem at the moment:
When we use the addxy command with no label , using a "" as 3rd parameter, everything works fine.
When we use a label (any string) it re-maps the gridlines to the points added by the addxy.

(Please see these pics for details)
http://80.80.244.49/download/moser/moser.zip

Code snippet:

// Axis definition //

Code: Select all

hHorizontalAxis = chTChartFieberkurve:TChart:Axis:AddCustom(TRUE).
        
        ASSIGN
            chTChartFieberkurve:TChart:Axis:Custom(0):PositionPercent = 0
            chTChartFieberkurve:TChart:Axis:Custom(0):MAXIMUM =  SichtbareTage
            chTChartFieberkurve:TChart:Axis:Custom(0):MINIMUM = 0
            chTChartFieberkurve:TChart:Axis:Custom(0):AUTOMATIC = FALSE
            chTChartFieberkurve:TChart:Axis:Custom(0):GridCentered = FALSE
            chTChartFieberkurve:TChart:Axis:Custom(0):Increment = 1
            chTChartFieberkurve:TChart:Axis:Custom(0):GridPen:VISIBLE = TRUE
            chTChartFieberkurve:TChart:Axis:Custom(0):GridPen:Style   = 0.
.....

// Assign the axis to all series , this is what the iseriesCnt is for //

Code: Select all

chTChartFieberkurve:TChart:Series(iSeriesCnt):HorizontalAxisCustom = hHorizontalAxis
.....

// Add values //

// this works //

Code: Select all

chTChartFieberkurve:TChart:Series(iSeriesCnt):AddXY 
                            (deXPos, mcs.mcVitalWerte.deWert1, "", mcs.mcsVitalKonfig.iFarbe).
// this doesnt //

Code: Select all

chTChartFieberkurve:TChart:Series(iSeriesCnt):AddXY 
                            (deXPos, mcs.mcVitalWerte.deWert1, STRING(ROWID(mcs.mcVitalWerte)), mcs.mcsVitalKonfig.iFarbe).
On a sidenote: we are using Progress :wink:


Question:

Is there a way to work around this? Or a option to set the gridlines fixed so they dont get remapped to the added values?

Thanks for your help.
AHIS

Posted: Fri Mar 30, 2007 11:50 am
by narcis
Hi AHIS,

I can not reproduce the problem here using TeeChart Pro v7.0.1.3 ActiveX, which is the latest version available at the client area, and the code below. Please notice that I never used Progress but I tried to create an example similar to the indications you provided.

Code: Select all

Private Sub Form_Load()
    Dim hAxis, MaxXVal As Integer
    

    TChart1.Aspect.View3D = False
    TChart1.Panel.MarginBottom = 10
    
    MaxXVal = 25
    hAxis = TChart1.Axis.AddCustom(True)
    
    With TChart1.Axis.Custom(hAxis)
        .PositionPercent = 0
        .Maximum = MaxXVal + 1
        .Minimum = 0
        .Automatic = False
        .GridCentered = False
        .Increment = 1
        .GridPen.Visible = True
        .GridPen.Style = psSolid
        .Labels.Style = talValue
    End With
    
    For i = 0 To 3
        TChart1.AddSeries scLine
        
        With TChart1.Series(i)
            .HorizontalAxisCustom = hAxis
            .asLine.Pointer.Visible = True
            .asLine.Pointer.Style = psDiagCross
            
            For j = 1 To MaxXVal
                '.AddXY j, Rnd, "", clTeeColor
                .AddXY j, Rnd, "Point " & CStr(j), clTeeColor
            Next j
        End With
    Next i
    
End Sub

Which TeeChart version are you using? Could you please send us a simple example we can run "as-is", modify my example or send us a Progress example we can translate to VB so that we can reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Mon Apr 02, 2007 7:27 am
by 9530384
Hi Narcís!

The Teechart Version we use is Pro 7.0.1.3 so that should be correct then..

I sent a zip file containing a basic progress Teechart demo file as well as 2 screens showing the error, the file is commented so you should be able to see where the problem is. I hope you can figure out why as well then :)

This is the response i got from using your upload page:
"Received Teechartminidemo.zip Content Type application/x-zip-compressed Length 50585"

Please tell me if i can help any further!

Oh and i checked your codesample above. Its very similar to the one i created for progress, however i noticed one difference.. my example uses one series where all points added with addxy use a comment as 3rd param, not some without and some with comment.. else i couldnt find any real difference :?

Edit: Something i just forgot to mention: the application we had worked fine when we were using teechart 6! We recently upgraded to teechart 7 and now got this strange behaviour.

Best Regards,
Steve

Posted: Mon Apr 02, 2007 9:22 am
by narcis
Hi Steve,

Thanks for the example. I tried creating something similar in VB6 as you can see below.

Your problem could be because you are not setting the horizontal axis label style as in my example. Could you please try this and let us know it that's the problem?

Code: Select all

Private Sub Form_Load()
    Dim hAxis, vAxis As Integer
   
    With TChart1
         .Aspect.View3D = False
         .Aspect.HorizOffset = 0
         .Aspect.VertOffset = 0
         .Environment.MouseWheelScroll = False
         .Footer.Visible = False
         .Header.Visible = False
         .Legend.Visible = False
         .Panel.MarginUnits = muPixels '1
         .Panel.MarginLeft = 50
         .Panel.MarginBottom = 30
         .Panel.MarginTop = 10
         .Panel.MarginRight = 15
         .Panel.Shadow.Transparency = 0
         .Walls.Visible = False
         .Axis.Top.Visible = False
         .Axis.Bottom.Visible = False
         .Axis.Right.Visible = False
         .Scroll.Enable = pmNone '0
         .Zoom.Enable = False
         
         .Axis.RemoveAllCustom
         .RemoveAllSeries
         .Tools.Clear
        
         MaxXVal = 25
         hAxis = .Axis.AddCustom(True)
         vAxis = .Axis.AddCustom(False)
        
         With .Axis.Custom(hAxis)
             .PositionPercent = 0
             .Maximum = 6000
             .Minimum = 0
             .Automatic = False
             .GridCentered = False
             .Increment = 500
             .GridPen.Visible = True
             .GridPen.Style = psSolid '0
             .Labels.Style = talValue
         End With
         
        With .Axis.Custom(vAxis)
             .PositionPercent = 0
             .Maximum = 140
             .Minimum = 0
             .Automatic = False
             .GridCentered = False
             .Increment = 10
             .GridPen.Visible = True
             .GridPen.Style = psDash '1
             '.Labels.Style = talValue
         End With
        
         For i = 0 To 2
             .AddSeries scFastLine '6
            
             With .Series(i)
                 .HorizontalAxisCustom = hAxis
                 .VerticalAxisCustom = vAxis
                
    '             For j = 1 To MaxXVal
    '                 '.AddXY j, Rnd, "", clTeeColor
    '                 .AddXY j, Rnd, "Point " & CStr(j), clTeeColor
    '             Next j
             End With
         Next i
         
        .Series(0).AddXY 756, 100, "test", clTeeColor '17538
        .Series(0).AddXY 1845, 80, "test", clTeeColor '18554
        .Series(0).AddXY 2947, 90, "test", clTeeColor '12687
        .Series(0).AddXY 3487, 70, "test", clTeeColor '14215
    
        .Series(1).AddXY 800, 50, "", clTeeColor '17538
        .Series(1).AddXY 1800, 40, "", clTeeColor '18554
        .Series(1).AddXY 2800, 70, "", clTeeColor '12687
    
        .Series(2).AddXY 1000, 10, "", clTeeColor '0
        .Series(2).AddXY 2000, 30, "", clTeeColor '0
        .Series(2).AddXY 3000, 50, "", clTeeColor '0
        .Series(2).AddXY 4000, 70, "", clTeeColor '0

     
    End With
    
End Sub

Posted: Mon Apr 02, 2007 10:04 am
by 9530384
Hi Narcís!

I tried adding the following line to my example now:

Code: Select all

chTChartFieberkurve:TChart:Axis:Custom(0):Labels:Style = 0.

but the problem still occurs.

Could you reconstruct my problem and did this solve it for you?

Best Regards,
Steve

Posted: Mon Apr 02, 2007 10:25 am
by narcis
Hi Steve,
I tried adding the following line to my example now:

Code:
chTChartFieberkurve:TChart:Axis:Custom(0):Labels:Style = 0.

but the problem still occurs.
Setting labels style to 0 indicates talAuto which is the default value, you should try setting it to 2:

Code: Select all

chTChartFieberkurve:TChart:Axis:Custom(0):Labels:Style = 2.
Could you reconstruct my problem and did this solve it for you?
I can't tell this for sure since your images don't show the horizontal axis labels since they are overlapped for the grid below the chart.

Posted: Mon Apr 02, 2007 11:16 am
by 9530384
Hi Narcís!

Thanks alot for the quick help, setting it to 2 worked for me as well!

Have a nice day still!

Greetings from Austria,
Steve

Posted: Mon Apr 02, 2007 12:40 pm
by narcis
Hi Steve,

You're welcome. I'm glad to hear that worked for you.

Have a nice day too!