Jump to content
Software FX Community

Dates on X-Axis


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...