Jump to content
Software FX Community

Dates on X-Axis


User (Legacy)

Recommended Posts

Hi, 

I can't get date values to appear on the X Axis. My X Axis values are

coming out of a database as datetime fields and they appear in balloons if

you mouseover them but aren't displayed.

Here is my code. Thanks for your help

rsPrices.open "Select ClosePrice, HistDate FROM ShareHistory WHERE Code = '"

& sSymbol & "'", oConn, 3, 3

iStepSize = Calcstepsize(iLowValue,iHighvalue)

iLoPoint = CalcLoPoint(iLowValue, iHighValue, iStepsize)

'--------------------------------------------------------------------------

' Set up the chart

Set ochart = Server.CreateObject("ChartFX.WebServer")

' Set the chart Properties

oChart.DateFormat = "dd-MMM-yy" ' X-Axis Date Format

ochart.ChartType = LINES ' Line Chart

oChart.Chart3D = false ' 3D Chart

oChart.Grid = CHART_HORZGRID Or CHART_VERTGRID ' Gridlines

oChart.ItemColor(CI_VERTGRID) = RGB(204,204,204) ' Gridline Color

oChart.ItemColor(CI_HORZGRID) = RGB(204,204,204) ' GridLine Color

ochart.Type = ochart.Type or CT_COLORLINE ' Coloured Lines

ochart.Type = ochart.Type And Not CT_POINTS ' No markers

'ochart.RgbBk = RGB(255,255,255) ' Border Background Color

ochart.Rgb2DBk = RGB(255,255,255) ' Background Color

ochart.Style = ochart.Style And Not CS_SCROLLABLE ' Not Scrollable

' Add the Data

ochart.AdoResultset rsPrices

' Set the Min, Max and Step Size

oChart.Adm(CSA_MIN) = iLoPoint

oChart.Adm(CSA_MAX) = iLoPoint + (10 * iStepSize)

oChart.Adm(CSA_GAP) = istepsize

' Open the communication channel to change 1 value

oChart.OpenDataEx COD_COLORS,1,0

' Set the colors

oChart.Color(0) = RGB(0,0,255)

' Close channel

oChart.CloseData COD_COLORS

Select case Request("sChartSize")

Case "Small"

Response.write(ochart.GetHtmlTag(300,200))

Case "Large"

Response.write(ochart.GetHtmlTag(800,600))

Case Else

Response.write(ochart.GetHtmlTag(400,300))

End Select

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...