Jump to content
Software FX Community

Re: Axis Formating Not Working


User (Legacy)

Recommended Posts

Ok, here is my example.  These were made by going into the designer.  My 

goal was to create a chart with the Y-Axis formated for scientific notation

and the x-axis formated for dates. First I outputed the code as ASP. ASP

is not what I am using, but I wanted to see if it would function correctly.

Then Code from the DTC is below:

<%@ Language=VBScript %>

<HTML>

<HEAD>

</HEAD>

<BODY>

<%

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

' General Settings

Chart1.TypeMask = &H6880401&

Chart1.LeftGap = 62

Chart1.MarkerShape = 1

' Axis Settings

Chart1.Axis(0).Max = 90

Chart1.Axis(0).Format = 3

Chart1.Axis(0).Format = 3

Chart1.Axis(2).Min = 36524

Chart1.Axis(2).Max = 36625.375

Chart1.Axis(2).Style = &H2828&

Chart1.Axis(2).Format = 5

Chart1.Axis(2).Format = 5

Chart1.RGBBk = &H1000000&

' This code allows ChartFX to know how many series the chart will have

Chart1.OpenDataEx 65,5,0

Chart1.CloseData 65

' Per-Series settings

Chart1.Series(0).MarkerShape = 0

Chart1.Series(0).LineStyle = 2

Chart1.Series(1).MarkerShape = 0

Chart1.Series(2).Gallery = 4

Chart1.Series(2).TypeMask = &H2880404&

Chart1.Series(2).MarkerShape = 2

Chart1.Series(2).MarkerSize = 4

Chart1.Series(2).BorderColor = &H100002A&

Chart1.Series(3).Gallery = 4

Chart1.Series(3).TypeMask = &H2880404&

Chart1.Series(3).MarkerShape = 2

Chart1.Series(3).MarkerSize = 4

Chart1.Series(3).BorderColor = &H1000000&

Chart1.Series(4).Gallery = 4

Chart1.Series(4).TypeMask = &H2880404&

Chart1.Series(4).MarkerShape = 2

Chart1.Series(4).MarkerSize = 4

Chart1.Series(4).BorderColor = &H1000030&

' Color Settings

Chart1.OpenDataEx 3,16,0

Chart1.Color(0) = &H1000030&

Chart1.Color(1) = &H1000030&

Chart1.Color(2) = &H100000C&

Chart1.Color(3) = &H1000030&

Chart1.Color(4) = &H1000000&

Chart1.CloseData 3

%>

<%= Chart1.GetHtmlTag(607,489,"Auto","Chart1") %>

</BODY>

</HTML>

Now this code produces the graph with the correct X/y axis formats. Now, I

switch the DTC to output Cold Fusion Code (this is what I am using). The

code is as follows:

<HTML>

<HEAD>

</HEAD>

<BODY>

<CFOBJECT ACTION="Create" NAME="Chart1" CLASS="ChartFX.WebServer">

<CFSET Chart1.UserAgent = #HTTP_USER_AGENT#>

<!-- General Settings -->

<CFSET Chart1.TypeMask = 109577217>

<CFSET Chart1.LeftGap = 62>

<CFSET Chart1.MarkerShape = 1>

<!-- Axis Settings -->

<CFSET Chart1Axis = Chart1.Axis>

<CFSET Chart1Axis0 = Chart1.GetArrayProp("Item",0,Chart1Axis)>

<CFSET Chart1Axis0.Max = 90>

<CFSET Chart1Axis0.Format = 3>

<CFSET Chart1Axis0.Format = 3>

<CFSET Chart1Axis2 = Chart1.GetArrayProp("Item",2,Chart1Axis)>

<CFSET Chart1Axis2.Min = 36524>

<CFSET Chart1Axis2.Max = 36625.375>

<CFSET Chart1Axis2.Style = 10280>

<CFSET Chart1Axis2.Format = 5>

<CFSET Chart1Axis2.Format = 5>

<CFSET Chart1.RGBBk = 16777216>

<!-- This code allows ChartFX to know how many series the chart will

have -->

<CFSET Chart1.OpenDataEx(65,5,0)>

<CFSET Chart1.CloseData(65)>

<!-- Per-Series settings -->

<CFSET Chart1Series = Chart1.Series>

<CFSET Chart1Series0 = Chart1.GetArrayProp("Item",0,Chart1Series)>

<CFSET Chart1Series0.MarkerShape = 0>

<CFSET Chart1Series0.LineStyle = 2>

<CFSET Chart1Series1 = Chart1.GetArrayProp("Item",1,Chart1Series)>

<CFSET Chart1Series1.MarkerShape = 0>

<CFSET Chart1Series2 = Chart1.GetArrayProp("Item",2,Chart1Series)>

<CFSET Chart1Series2.Gallery = 4>

<CFSET Chart1Series2.TypeMask = 42468356>

<CFSET Chart1Series2.MarkerShape = 2>

<CFSET Chart1Series2.MarkerSize = 4>

<CFSET Chart1Series2.BorderColor = 16777258>

<CFSET Chart1Series3 = Chart1.GetArrayProp("Item",3,Chart1Series)>

<CFSET Chart1Series3.Gallery = 4>

<CFSET Chart1Series3.TypeMask = 42468356>

<CFSET Chart1Series3.MarkerShape = 2>

<CFSET Chart1Series3.MarkerSize = 4>

<CFSET Chart1Series3.BorderColor = 16777216>

<CFSET Chart1Series4 = Chart1.GetArrayProp("Item",4,Chart1Series)>

<CFSET Chart1Series4.Gallery = 4>

<CFSET Chart1Series4.TypeMask = 42468356>

<CFSET Chart1Series4.MarkerShape = 2>

<CFSET Chart1Series4.MarkerSize = 4>

<CFSET Chart1Series4.BorderColor = 16777264>

<!-- Other Settings -->

<CFSET Chart1.Border = 6553608>

<!-- Color Settings -->

<CFSET Chart1.OpenDataEx(3,16,0)>

<CFSET Chart1.SetArrayProp("Color",0,16777264)>

<CFSET Chart1.SetArrayProp("Color",1,16777264)>

<CFSET Chart1.SetArrayProp("Color",2,16777228)>

<CFSET Chart1.SetArrayProp("Color",3,16777264)>

<CFSET Chart1.SetArrayProp("Color",4,16777216)>

<CFSET Chart1.CloseData(3)>

<CFOUTPUT> # Chart1.GetHtmlTag(607,489,"Auto","Chart1") # </CFOUTPUT>

</BODY>

</HTML>

Now, this does not produce the same graph as ASP. The Y-Axis is still

formatted for normal numbers. The X-Axis, instead of showing dates, is

showing numbers like 36524 and 36525. These are the serial date numbers,

but it is not formatting them as dates. It seems that in Cold Fusion, the

control ignores the axis formating commands.

Now for my custom formatting question. Refering to the example titled

"Formating Y axis labels". The last line of the example code for ASP is :

chart.Axis(AXIS_Y).Format = "#,##0.#"

I want to know how to make a similar declaration using Cold Fusion.

Regards,

Chris Denslow

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...