Jump to content
Software FX Community

X-axis Dates in stacked bar chart


User (Legacy)

Recommended Posts

I have been implementing a prototype of application that may use ChartFX (if

we can get it working right). I ran into a problem with dates on the x-axis

and the documentation that comes with the trail version doesn't explain what

I need to do to properly setup dates. The samples show some but still I

have this problem.

Please see the following code for details:

With ChartFX1

' Initilize chart with values (3 series and 12 data point, i.e. each

month)

.OpenDataEx COD_VALUES, 3, 12

For i = 0 To 11

.Series(0).Yvalue(i) = totalCompletedHrs(i + 1)

.Series(1).Yvalue(i) = totalUnscheduledHrs(i + 1)

' .Series(0).Xvalue(i) = Format(repdates(i + 1), "mmm-yy")

If TotalSchedHrs(i + 1) = 0 Then

.Series(2).Yvalue(i) = 0

Else

.Series(2).Yvalue(i) = (totalCompletedHrs(i + 1) /

TotalSchedHrs(i + 1))

End If

Next

.CloseData COD_VALUES

.Series(0).Gallery = BAR

.Series(1).Gallery = BAR

.Series(1).Stacked = True

.Series(2).YAxis = AXIS_Y2

.Series(2).Gallery = LINES

.Axis(AXIS_X).Format = "DMMM-yy"

.Axis(AXIS_X).Min = CDate("05/13/02") 'startDate

.Axis(AXIS_X).Max = CDate("04/13/03")

.Axis(AXIS_X).STEP = 1

.Axis(AXIS_X).LabelAngle = 90

.Axis(AXIS_X).FirstLabel = 1

(more code here setting up Y2 axis)

End With

The problem I have is the Date never seems to change for each data point on

the x-axis.

It always May-02 for all points on the x-axis. What is should do is May-02,

Jun-02, Jul-02 ....

Can someone explain to me what I am doing wrong? It would be much

appreciated!

Michael Hongslo

Gavia Technologies, Inc.

Link to comment
Share on other sites

Bar charts don't support X-Values, therefore, the dates must be passed as

labels using the Legend property (or Axis(AXIS_X).Label).

If you have one data point per day then you can use a numeric X-Axis. In

your case I think you need one point per month so this approach wouldn't

work. So you need to use the Legend property as mentioned above.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...