Page 1 of 1

Council (and help) for a graph

Posted: Wed Mar 18, 2009 10:26 am
by 15052665
Hi

I'm trying to do this chart with no succeed.
This is a exemple
Image



So i'm asking your help.

I have some value (Char).
XValue=Day
YValue=Hour
I want to show a value with this XValue and YValue.

What SerieClass i need to use.
I'm trying with Gantt, Bar3D but i can't modify the mark to show my value.

I'm working with Magic Software.
I'm sorry for my english.
Thx for your help

Posted: Wed Mar 18, 2009 1:01 pm
by yeray
Hi Onyx,

Here is an example in vb6 that tries to draw a chart as in your picture:

Code: Select all

Private Sub Form_Load()
  With TChart1
    .Aspect.View3D = False
    .AddSeries scGantt
    .Series(0).XValues.DateTime = True
    .Series(0).YValues.DateTime = True
  
    .Axis.Left.Labels.Style = talValue
  
    With .Series(0).asGantt
      .AddGanttColor DateValue("2009-03-01") + TimeValue("2:00"), DateValue("2009-03-01") + TimeValue("21:59"), TimeValue("18:00"), "D++", RGB(255, 128, 0)
      .AddGanttColor DateValue("2009-03-01") + TimeValue("2:00"), DateValue("2009-03-01") + TimeValue("21:59"), TimeValue("6:00"), "C", RGB(128, 64, 0)
      .AddGanttColor DateValue("2009-03-02") + TimeValue("2:00"), DateValue("2009-03-02") + TimeValue("21:59"), TimeValue("6:00"), "N+", vbGreen
      .AddGanttColor DateValue("2009-03-03") + TimeValue("2:00"), DateValue("2009-03-03") + TimeValue("21:59"), TimeValue("6:00"), "N+", vbGreen
      .AddGanttColor DateValue("2009-03-03") + TimeValue("2:00"), DateValue("2009-03-03") + TimeValue("21:59"), TimeValue("21:00"), "M++", vbBlack
      .Pointer.VerticalSize = 8
    End With
  
    .Series(0).Marks.Visible = True
    .Series(0).Marks.Item(1).Font.Color = vbWhite
    .Series(0).Marks.Item(4).Font.Color = vbWhite
    
    For i = 0 To .Series(0).Count - 1
      .Series(0).Marks.Item(i).Transparent = True
    Next i
    
    .Axis.Left.SetMinMax TimeValue("0:00"), TimeValue("23:59")
  End With
End Sub

Posted: Wed Mar 18, 2009 4:09 pm
by 15052665
Thx for your help
During my test, i'm using AddGantt method but with AddGanttColor, it work fine.
Thanks a lot