I have a program that I wrote many years ago, that I needed to clean up the tickmarks and labels on. I decided I would use a routine in the axis example to "AutoDefineAxis". After much playing with things, I got things to look just like I wanted except two things happened. For my normal data I had no problems, but if I got much larger data that needed more time on chart, I get no graph at all, and it frieezes (since buttons to return are part of graph. The other problem is that even though I am setting the label format using SetAxisLabelsFormat(ChartObj.TIMEDATEFORMAT_24HM) Only half of the date disappears instead of the whole date. Here is the code I used for the "AutoDefineAxis" routine.
Public Sub AutoDefineAxis(ByVal transform As TimeCoordinates, ByVal theFont As Font, ByVal axistimebase As Integer, ByVal captionstring As [String]) Dim xAxis1 As New TimeAxis(transform) xAxis1.SetAxisTickMarkTimeBase(axistimebase) chartVu.AddChartObject(xAxis1)
Dim xAxisLab1 As New TimeAxisLabels(xAxis1) xAxisLab1.SetAxisLabelsFormat(ChartObj.TIMEDATEFORMAT_24HM) xAxisLab1.SetTextFont(theFont) chartVu.AddChartObject(xAxisLab1)
Dim caption1 As New ChartText(transform, theFont, "Hours:Minutes into Run", 0.48, 0.995, ChartObj.NORM_GRAPH_POS, ChartObj.JUSTIFY_CENTER, ChartObj.JUSTIFY_CENTER, 0) caption1.SetXJust(ChartObj.JUSTIFY_CENTER) caption1.SetYJust(ChartObj.JUSTIFY_CENTER) caption1.SetColor(Color.Crimson) caption1.SetTextFont(theFont) chartVu.AddChartObject(caption1) End Sub 'AutoDefineAxis
Can anyone help me figure out what I'm doing wrong? Before I started, I would get all size charts, but tickmarks and labels were not correct. I was not using this routine to set the tickmarks and labels, I was doing it myself, but it never came out correctly.
mcgormand
|