User (Legacy) Posted November 11, 2003 Report Share Posted November 11, 2003 Hi, I am creating a bar chart using ChartFX 2000 IE 5.5.11.0. The chart is created correctly, and the legend shows up as expected when I use Auto in the 3rd parameter of the getHtmlTag. However, no legend appears when I use "Image" in the third paramter of the getHtmlTag. When using Auto, I expect and recieve an activeX control. When using "Image" I expect and recieve a .png file and the chart is generated correctly EXCEPT there is no legend. Do I have to do something special to have the legend show up when generating an image? Here is the code that sets the legend, and I beleve allows display of the legend. ChartFX1.Series(0).Legend = statNm1; ChartFX1.SerLegBox = true; I've also attached the two charts so you can see the difference (Auto vs Image). Thank you, Joel R. DeRider IceT Corporation Link to comment Share on other sites More sharing options...
Software FX Posted November 12, 2003 Report Share Posted November 12, 2003 We are unable to reproduce this problem. Can you please send the rest of the code that deals with the chart, e.g. Whenre do you move the legend box to the top ? We need to have a repro case. I Tried the following simple page and it worked fine: <HTML> <HEAD> </HEAD> <BODY bgcolor="F0FFFF"> <!-- #include virtual="/Include/CfxIE.inc" --> <!-- #include virtual="/Include/CfxIEExtra.inc" --> <!-- #include virtual="/Include/CfxIECmds.inc" --> <% Set chart = Server.CreateObject("ChartFX.WebServer") chart.SerLeg(0) = "Series 1" chart.SerLegBoxObj.Docked = TGFP_TOP chart.SerLegBox = true %> <br> <%=chart.GetHtmltag(300,300,"image")%> </BODY> </HTML> -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 13, 2003 Author Report Share Posted November 13, 2003 Hi, I appreciate you trying to recreate the problem. I'm sorry I didn't supply the entire code set, but here it is now. If you need any other portions of the code, just let me know. I'm happy to provide whatever you need! This code has a series of "if" statements in it that are used to determine the number of series to display. From one to three series are shown on the report (user defined). The example I provided originally is a single series for simplicity. This chart also enables drill down, although I doubt that is the issue here. Hope this is what you need! Thank you, Joel var CfxArray = Server.CreateObject("CfxData.Array"); CfxArray.AddArray(XDate); CfxArray.AddArray(YMetric1); ChartFX1.DataType(1) = CDT_VALUE; if (numOfMetrics >= 2) { CfxArray.AddArray(YMetric2); ChartFX1.DataType(2) = CDT_VALUE; } if (numOfMetrics == 3) { CfxArray.AddArray(YMetric3); ChartFX1.DataType(3) = CDT_VALUE; } ChartFX1.GetExternalData(CfxArray); if (numOfMetrics == 1) { ChartFX1.Series(0).Legend = statNm1; } else { ChartFX1.Series(0).Legend = statNm1+' * '+YMetricLevel1; } if (statNm2 != "") { // Response.Write("<br>numbertwo<br>"+statNm2); ChartFX1.Series(1).Legend = statNm2+' * '+YMetricLevel2; } if (statNm3 != "") { // Response.Write("<br>numberthree<br>"+statNm3); ChartFX1.Series(2).Legend = statNm3+' * '+YMetricLevel3; } ChartFX1.SerLegBoxObj.Docked = TGFP_TOP; ChartFX1.SerLegBox = true; if (groupBy == "Mon") dId = "Day"; else if (groupBy == "Day") dId = "60"; else if (groupBy == "60") dId = "30"; else if (groupBy == "30") dId = "15"; else if (groupBy == "15") dId = "05"; if (groupBy != "05") { ChartFX1.URLParamMask = "dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S"; ChartFX1.URL(0) = "sst_graph_out.asp"; ChartFX1.URL(1) = "sst_graph_out.asp"; ChartFX1.URL(2) = "sst_graph_out.asp"; ChartFX1.URLOptions = CHART_URL_JUMP || CHART_URL_PARAM; ChartFX1.URLTarget = "_blank"; ChartFX1.DblClk(CHART_URLCLK,0); } ChartFX1.ToolBar = true; ChartFX1.ToolBarObj.Visible = true; if (ChartGenType == "Auto") { Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10)) ) } else { Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10), "Image")) } ----- Original Message ----- From: "SoftwareFX Support" <support@softwarefx.com> Newsgroups: chartfx.internet.55 Sent: Wednesday, November 12, 2003 10:11 AM Subject: Re: No Legend when creating image > We are unable to reproduce this problem. Can you please send the rest of the > code that deals with the chart, e.g. Whenre do you move the legend box to > the top ? We need to have a repro case. > > I Tried the following simple page and it worked fine: > > <HTML> > <HEAD> > </HEAD> > <BODY bgcolor="F0FFFF"> > <!-- #include virtual="/Include/CfxIE.inc" --> > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > <!-- #include virtual="/Include/CfxIECmds.inc" --> > <% > Set chart = Server.CreateObject("ChartFX.WebServer") > chart.SerLeg(0) = "Series 1" > chart.SerLegBoxObj.Docked = TGFP_TOP > chart.SerLegBox = true > %> > <br> > <%=chart.GetHtmltag(300,300,"image")%> > </BODY> > </HTML> > > -- > FP > Software FX, Inc. > > "SoftwareFX Support" <support@softwarefx.com> wrote in message news:eDD1geTqDHA.1900@WEBSERVER1... > We are unable to reproduce this problem. Can you please send the rest of the > code that deals with the chart, e.g. Whenre do you move the legend box to > the top ? We need to have a repro case. > > I Tried the following simple page and it worked fine: > > <HTML> > <HEAD> > </HEAD> > <BODY bgcolor="F0FFFF"> > <!-- #include virtual="/Include/CfxIE.inc" --> > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > <!-- #include virtual="/Include/CfxIECmds.inc" --> > <% > Set chart = Server.CreateObject("ChartFX.WebServer") > chart.SerLeg(0) = "Series 1" > chart.SerLegBoxObj.Docked = TGFP_TOP > chart.SerLegBox = true > %> > <br> > <%=chart.GetHtmltag(300,300,"image")%> > </BODY> > </HTML> > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
Software FX Posted November 14, 2003 Report Share Posted November 14, 2003 I took you code and modify it so that it will run in my server. By the way, what scripting language is your code in ? JavaScript ? I wasn't sure. I translated it to VB script and run it. I got good results for both the Image and the ActiveX. Are you using the latest SP ? please check in our support site. Here is the modified code, please try it in a separate ASP and let me know what you get. <HTML> <HEAD> </HEAD> <BODY bgcolor="F0FFFF"> <!-- #include virtual="/Include/CfxIE.inc" --> <!-- #include virtual="/Include/CfxIEExtra.inc" --> <!-- #include virtual="/Include/CfxIECmds.inc" --> <% Set ChartFX1 = Server.CreateObject("ChartFX.WebServer") Set CfxArray = Server.CreateObject("CfxData.Array") Dim XDate(3) XDate(0) = "a" XDate(1) = "b" XDate(2) = "c" Dim YMetric1(3) YMetric1(0) = 10 YMetric1(1) = 20 YMetric1(2) = 30 CfxArray.AddArray(XDate) CfxArray.AddArray(YMetric1) ChartFX1.DataType(1) = CDT_VALUE if (numOfMetrics >= 2) then CfxArray.AddArray(YMetric2) ChartFX1.DataType(2) = CDT_VALUE end if if (numOfMetrics = 3) then CfxArray.AddArray(YMetric3) ChartFX1.DataType(3) = CDT_VALUE end if ChartFX1.GetExternalData(CfxArray) if (numOfMetrics = 1) Then ChartFX1.Series(0).Legend = statNm1 else ChartFX1.Series(0).Legend = statNm1+" * "+YMetricLevel1 end if if (statNm2 <> "") then // Response.Write("<br>numbertwo<br>"+statNm2) ChartFX1.Series(1).Legend = statNm2+"* "+YMetricLevel2 end if if (statNm3 <> "") then // Response.Write("<br>numberthree<br>"+statNm3) ChartFX1.Series(2).Legend = statNm3+" * "+YMetricLevel3 end if ChartFX1.SerLegBoxObj.Docked = TGFP_TOP ChartFX1.SerLegBox = true if (groupBy = "Mon") then dId = "Day" else if (groupBy = "Day") then dId = "60" else if (groupBy = "60") then dId = "30" else if (groupBy = "30") then dId = "15" else if (groupBy = "15") then dId = "05" end if end if end if end if end if if (groupBy <> "05") then ChartFX1.URLParamMask ="dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S" ChartFX1.URL(0) = "sst_graph_out.asp" ChartFX1.URL(1) = "sst_graph_out.asp" ChartFX1.URL(2) = "sst_graph_out.asp" ChartFX1.URLOptions = CHART_URL_JUMP or CHART_URL_PARAM ChartFX1.URLTarget = "_blank" ChartFX1.DblClk CHART_URLCLK,0 end if ChartFX1.ToolBar = true ChartFX1.ToolBarObj.Visible = true If (ChartGenType = "Auto") Then Response.Write(ChartFX1.GetHtmlTag(300,300)) else Response.Write(ChartFX1.GetHtmlTag(300,300,"Image")) end if %> <br> </BODY> </HTML> -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 14, 2003 Author Report Share Posted November 14, 2003 Thanks for the sample! I ran the sample got a graph (image) that showed a legend box. That's good, it probably means I'm up to date on everything. I have the latest everything from IIS / VID / ChartFX as far as I know. So, there is something in my code that must be blocking the display of the legend. I spent some time trimming the fat from the entire ASP that creates this chart. Mostly I pulled out the SQL and SQL execution. I cannot run the results, but it shows the myriad of settings that are being used in the ASP for the chart. Is there anything within this code that would make you believe I am in fact blocking the display of the legend? Thanks again for all the help, and let me know if I can either test or provide some other information to help in getting to the bottom of this problem. Joel <%@ Language=JavaScript %> <% Response.Expires = 0 %> <% // VI 6.0 Scripting Object Model Enabled %> <!--#include file="_ScriptLibrary/pm.asp"--> <form name="thisForm" METHOD="post"> <!-- #include virtual="/Include/CfxIE.inc" --> <% ChartFX1 = Server.CreateObject('ChartFX.WebServer'); ChartFX1.TypeMask = 0x2880502; ChartFX1.Axis(0).TickMark = -32767; if (numOfMetrics == 1) { ChartFX1.Title(0) = 'Actual Values'; } else { ChartFX1.Title(0) = 'Scaled Percentage'; } // ChartFX1.Title(1) = 'IceT Corporation'; ChartFX1.Title(CHART_TOPTIT) = "CLARIT FOR ORACLE -- SYSTEM STATISTICS GRAPH \n"+ "Collection: " + collName; ChartFX1.Fonts(CHART_TOPFT) = 12; groupByDisp = groupBy; ChartFX1.Title(3) = "Observations from "+startTS+" to "+stopTS+" Grouped by "+groupByDisp; ChartFX1.Title(4) = 'Title Four'; ChartFX1.Printer.Style = 6; ChartFX1.Gallery = BAR; ChartFX1.Chart3D = true; ChartFX1.Stacked = CHART_NOSTACKED; ChartFX1.Axis(0).Grid = true; ChartFX1.Palette = "Dark Pastels"; ChartFX1.LegendBox = false; ChartFX1.SerLegBox = true; ChartFX1.ToolBar = true; ChartFX1.Axis(AXIS_X).LabelAngle = xValueAlignment; ChartFX1.AllowResize = true; ChartFX1.DblClk(CHART_PROPERTIESCLK,0); ChartFX1.AllowDrag = false; ChartFX1.AllowEdit = false; ChartFX1.ContextMenus = true; ChartFX1.ShowTips = true; ChartFX1.Scrollable = true; ChartFX1.Style = ChartFX1.Style || CS_GALLERY; ChartFX1.LegendBoxObj.Moveable = true; ChartFX1.LegendBoxObj.Sizeable = 2; ChartFX1.SerLegBoxObj.Moveable = true; ChartFX1.SerLegBoxObj.Sizeable = 2; ChartFX1.DataEditorObj.Moveable = true; ChartFX1.DataEditorObj.Sizeable = 3; ChartFX1.ToolBarObj.Moveable = true; ChartFX1.ToolBar = true; ChartFX1.PaletteBar = false; ChartFX1.PatternBar = false; ChartFX1.DataEditor = false; ChartFX1.AllowEdit = false; ChartFX1.MenuBar = false; ChartFX1.ToolBarObj.RemoveItems(2,0) ChartFX1.ToolBarObj.RemoveItems(1,3) ChartFX1.ToolBarObj.RemoveItems(6,6) var CfxArray = Server.CreateObject("CfxData.Array"); CfxArray.AddArray(XDate); CfxArray.AddArray(YMetric1); ChartFX1.DataType(1) = CDT_VALUE; if (numOfMetrics >= 2) { CfxArray.AddArray(YMetric2); ChartFX1.DataType(2) = CDT_VALUE; } if (numOfMetrics == 3) { CfxArray.AddArray(YMetric3); ChartFX1.DataType(3) = CDT_VALUE; } ChartFX1.GetExternalData(CfxArray); if (numOfMetrics == 1) { ChartFX1.Series(0).Legend = statNm1; } else { ChartFX1.Series(0).Legend = statNm1+' * '+YMetricLevel1; } if (statNm2 != "") { ChartFX1.Series(1).Legend = statNm2+' * '+YMetricLevel2; } if (statNm3 != "") { ChartFX1.Series(2).Legend = statNm3+' * '+YMetricLevel3; } ChartFX1.SerLegBoxObj.Docked = TGFP_TOP; ChartFX1.SerLegBox = true; if (groupBy == "Mon") dId = "Day"; else if (groupBy == "Day") dId = "60"; else if (groupBy == "60") dId = "30"; else if (groupBy == "30") dId = "15"; else if (groupBy == "15") dId = "05"; if (groupBy != "05") { ChartFX1.URLParamMask = "dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S"; ChartFX1.URL(0) = "sst_graph_out.asp"; ChartFX1.URL(1) = "sst_graph_out.asp"; ChartFX1.URL(2) = "sst_graph_out.asp"; ChartFX1.URLOptions = CHART_URL_JUMP || CHART_URL_PARAM; ChartFX1.URLTarget = "_blank"; ChartFX1.DblClk(CHART_URLCLK,0); } %> <% ChartFX1.ToolBar = true; ChartFX1.ToolBarObj.Visible = true; if (ChartGenType == "Auto") { Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10)) ) } else { Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10), "Image")) } %> </body> <% // VI 6.0 Scripting Object Model Enabled %> <% EndPageProcessing() %> </form> </html> ----- Original Message ----- From: "SoftwareFX Support" <support@softwarefx.com> Newsgroups: chartfx.internet.55 Sent: Friday, November 14, 2003 9:25 AM Subject: Re: No Legend when creating image > I took you code and modify it so that it will run in my server. > > By the way, what scripting language is your code in ? JavaScript ? I wasn't > sure. > > I translated it to VB script and run it. I got good results for both the > Image and the ActiveX. Are you using the latest SP ? please check in our > support site. > > Here is the modified code, please try it in a separate ASP and let me know > what you get. > > <HTML> > <HEAD> > </HEAD> > <BODY bgcolor="F0FFFF"> > <!-- #include virtual="/Include/CfxIE.inc" --> > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > <!-- #include virtual="/Include/CfxIECmds.inc" --> > > <% > Set ChartFX1 = Server.CreateObject("ChartFX.WebServer") > Set CfxArray = Server.CreateObject("CfxData.Array") > > Dim XDate(3) > XDate(0) = "a" > XDate(1) = "b" > XDate(2) = "c" > Dim YMetric1(3) > YMetric1(0) = 10 > YMetric1(1) = 20 > YMetric1(2) = 30 > > CfxArray.AddArray(XDate) > CfxArray.AddArray(YMetric1) > ChartFX1.DataType(1) = CDT_VALUE > if (numOfMetrics >= 2) then > CfxArray.AddArray(YMetric2) > ChartFX1.DataType(2) = CDT_VALUE > end if > if (numOfMetrics = 3) then > CfxArray.AddArray(YMetric3) > ChartFX1.DataType(3) = CDT_VALUE > end if > ChartFX1.GetExternalData(CfxArray) > > if (numOfMetrics = 1) Then > ChartFX1.Series(0).Legend = statNm1 > else > ChartFX1.Series(0).Legend = statNm1+" * "+YMetricLevel1 > end if > if (statNm2 <> "") then > // Response.Write("<br>numbertwo<br>"+statNm2) > ChartFX1.Series(1).Legend = statNm2+"* "+YMetricLevel2 > end if > if (statNm3 <> "") then > // Response.Write("<br>numberthree<br>"+statNm3) > ChartFX1.Series(2).Legend = statNm3+" * "+YMetricLevel3 > end if > ChartFX1.SerLegBoxObj.Docked = TGFP_TOP > ChartFX1.SerLegBox = true > if (groupBy = "Mon") then > dId = "Day" > else > if (groupBy = "Day") then > dId = "60" > else > if (groupBy = "60") then > dId = "30" > else > if (groupBy = "30") then > dId = "15" > else > if (groupBy = "15") then > dId = "05" > end if > end if > end if > end if > end if > > if (groupBy <> "05") then > ChartFX1.URLParamMask > ="dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S" > ChartFX1.URL(0) = "sst_graph_out.asp" > ChartFX1.URL(1) = "sst_graph_out.asp" > ChartFX1.URL(2) = "sst_graph_out.asp" > ChartFX1.URLOptions = CHART_URL_JUMP or CHART_URL_PARAM > ChartFX1.URLTarget = "_blank" > ChartFX1.DblClk CHART_URLCLK,0 > end if > ChartFX1.ToolBar = true > ChartFX1.ToolBarObj.Visible = true > If (ChartGenType = "Auto") Then > > Response.Write(ChartFX1.GetHtmlTag(300,300)) > else > > Response.Write(ChartFX1.GetHtmlTag(300,300,"Image")) > end if > > > %> > <br> > > > </BODY> > </HTML> > > > -- > FP > Software FX, Inc. > > "SoftwareFX Support" <support@softwarefx.com> wrote in message news:wXUGVOsqDHA.1896@WEBSERVER1... > I took you code and modify it so that it will run in my server. > > By the way, what scripting language is your code in ? JavaScript ? I wasn't > sure. > > I translated it to VB script and run it. I got good results for both the > Image and the ActiveX. Are you using the latest SP ? please check in our > support site. > > Here is the modified code, please try it in a separate ASP and let me know > what you get. > > <HTML> > <HEAD> > </HEAD> > <BODY bgcolor="F0FFFF"> > <!-- #include virtual="/Include/CfxIE.inc" --> > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > <!-- #include virtual="/Include/CfxIECmds.inc" --> > > <% > Set ChartFX1 = Server.CreateObject("ChartFX.WebServer") > Set CfxArray = Server.CreateObject("CfxData.Array") > > Dim XDate(3) > XDate(0) = "a" > XDate(1) = "b" > XDate(2) = "c" > Dim YMetric1(3) > YMetric1(0) = 10 > YMetric1(1) = 20 > YMetric1(2) = 30 > > CfxArray.AddArray(XDate) > CfxArray.AddArray(YMetric1) > ChartFX1.DataType(1) = CDT_VALUE > if (numOfMetrics >= 2) then > CfxArray.AddArray(YMetric2) > ChartFX1.DataType(2) = CDT_VALUE > end if > if (numOfMetrics = 3) then > CfxArray.AddArray(YMetric3) > ChartFX1.DataType(3) = CDT_VALUE > end if > ChartFX1.GetExternalData(CfxArray) > > if (numOfMetrics = 1) Then > ChartFX1.Series(0).Legend = statNm1 > else > ChartFX1.Series(0).Legend = statNm1+" * "+YMetricLevel1 > end if > if (statNm2 <> "") then > // Response.Write("<br>numbertwo<br>"+statNm2) > ChartFX1.Series(1).Legend = statNm2+"* "+YMetricLevel2 > end if > if (statNm3 <> "") then > // Response.Write("<br>numberthree<br>"+statNm3) > ChartFX1.Series(2).Legend = statNm3+" * "+YMetricLevel3 > end if > ChartFX1.SerLegBoxObj.Docked = TGFP_TOP > ChartFX1.SerLegBox = true > if (groupBy = "Mon") then > dId = "Day" > else > if (groupBy = "Day") then > dId = "60" > else > if (groupBy = "60") then > dId = "30" > else > if (groupBy = "30") then > dId = "15" > else > if (groupBy = "15") then > dId = "05" > end if > end if > end if > end if > end if > > if (groupBy <> "05") then > ChartFX1.URLParamMask > ="dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S" > ChartFX1.URL(0) = "sst_graph_out.asp" > ChartFX1.URL(1) = "sst_graph_out.asp" > ChartFX1.URL(2) = "sst_graph_out.asp" > ChartFX1.URLOptions = CHART_URL_JUMP or CHART_URL_PARAM > ChartFX1.URLTarget = "_blank" > ChartFX1.DblClk CHART_URLCLK,0 > end if > ChartFX1.ToolBar = true > ChartFX1.ToolBarObj.Visible = true > If (ChartGenType = "Auto") Then > > Response.Write(ChartFX1.GetHtmlTag(300,300)) > else > > Response.Write(ChartFX1.GetHtmlTag(300,300,"Image")) > end if > > > %> > <br> > > > </BODY> > </HTML> > > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 14, 2003 Author Report Share Posted November 14, 2003 Hi, Good news! I spent about 5 hours slowly removing these parameters one by one and found the problem. However I don't understand it, so if anyone could give me some clarification that would be wonderul! The following line when commented out fixed the problem (the image is now generated with a legend). ChartFX1.Printer.Style = 6; The 6 appears to be an attempt to enable two printer styles "CHART_PRS_FORCECOLORS" and "CHART_PRS_SEPARATE_LEGEND". I checked the documentation and that line may be incorrect. I believe the 6 is supposed to be 'OR'd with the base style as: ChartFX1.Printer.Style=ChartFX1.Printer.Style || 6; (remember that I'm using jscript). However, I would prefer to use constants, so I tried using them, but they no longer exist in any of the ChartFX include files including CFxiEExtra.inc. 1) Was the original line OK, and is this a bug of some kind? 2) Was the original line coded wrong (no 'OR'). 3) Where are the printer constants? Have they been renamed? Thanks for all the help (I really am breathing easier now)! Joel "Joel R. DeRider" <joel.derider@icetcorp.com> wrote in message news:R6B1SBvqDHA.1896@WEBSERVER1... > Thanks for the sample! > > I ran the sample got a graph (image) that showed a legend box. That's good, > it probably means I'm up to date on everything. I have the latest > everything from IIS / VID / ChartFX as far as I know. So, there is > something in my code that must be blocking the display of the legend. I > spent some time trimming the fat from the entire ASP that creates this > chart. Mostly I pulled out the SQL and SQL execution. I cannot run the > results, but it shows the myriad of settings that are being used in the ASP > for the chart. Is there anything within this code that would make you > believe I am in fact blocking the display of the legend? > > Thanks again for all the help, and let me know if I can either test or > provide some other information to help in getting to the bottom of this > problem. > > Joel > <%@ Language=JavaScript %> > <% Response.Expires = 0 %> > <% // VI 6.0 Scripting Object Model Enabled %> > <!--#include file="_ScriptLibrary/pm.asp"--> > <form name="thisForm" METHOD="post"> > <!-- #include virtual="/Include/CfxIE.inc" --> > > <% > ChartFX1 = Server.CreateObject('ChartFX.WebServer'); > ChartFX1.TypeMask = 0x2880502; > ChartFX1.Axis(0).TickMark = -32767; > if (numOfMetrics == 1) { > ChartFX1.Title(0) = 'Actual Values'; > } > else { > ChartFX1.Title(0) = 'Scaled Percentage'; > } > // ChartFX1.Title(1) = 'IceT Corporation'; > ChartFX1.Title(CHART_TOPTIT) = "CLARIT FOR ORACLE -- SYSTEM STATISTICS > GRAPH \n"+ > "Collection: " + collName; > > ChartFX1.Fonts(CHART_TOPFT) = 12; > groupByDisp = groupBy; > ChartFX1.Title(3) = "Observations from "+startTS+" to "+stopTS+" Grouped > by "+groupByDisp; > ChartFX1.Title(4) = 'Title Four'; > ChartFX1.Printer.Style = 6; > ChartFX1.Gallery = BAR; > ChartFX1.Chart3D = true; > ChartFX1.Stacked = CHART_NOSTACKED; > ChartFX1.Axis(0).Grid = true; > ChartFX1.Palette = "Dark Pastels"; > ChartFX1.LegendBox = false; > ChartFX1.SerLegBox = true; > ChartFX1.ToolBar = true; > ChartFX1.Axis(AXIS_X).LabelAngle = xValueAlignment; > ChartFX1.AllowResize = true; > ChartFX1.DblClk(CHART_PROPERTIESCLK,0); > ChartFX1.AllowDrag = false; > ChartFX1.AllowEdit = false; > ChartFX1.ContextMenus = true; > ChartFX1.ShowTips = true; > ChartFX1.Scrollable = true; > ChartFX1.Style = ChartFX1.Style || CS_GALLERY; > ChartFX1.LegendBoxObj.Moveable = true; > ChartFX1.LegendBoxObj.Sizeable = 2; > ChartFX1.SerLegBoxObj.Moveable = true; > ChartFX1.SerLegBoxObj.Sizeable = 2; > ChartFX1.DataEditorObj.Moveable = true; > ChartFX1.DataEditorObj.Sizeable = 3; > ChartFX1.ToolBarObj.Moveable = true; > ChartFX1.ToolBar = true; > ChartFX1.PaletteBar = false; > ChartFX1.PatternBar = false; > ChartFX1.DataEditor = false; > ChartFX1.AllowEdit = false; > ChartFX1.MenuBar = false; > ChartFX1.ToolBarObj.RemoveItems(2,0) > ChartFX1.ToolBarObj.RemoveItems(1,3) > ChartFX1.ToolBarObj.RemoveItems(6,6) > var CfxArray = Server.CreateObject("CfxData.Array"); > CfxArray.AddArray(XDate); > CfxArray.AddArray(YMetric1); > ChartFX1.DataType(1) = CDT_VALUE; > if (numOfMetrics >= 2) { > CfxArray.AddArray(YMetric2); > ChartFX1.DataType(2) = CDT_VALUE; > } > if (numOfMetrics == 3) { > CfxArray.AddArray(YMetric3); > ChartFX1.DataType(3) = CDT_VALUE; > } > ChartFX1.GetExternalData(CfxArray); > > if (numOfMetrics == 1) { > ChartFX1.Series(0).Legend = statNm1; > } > else { > ChartFX1.Series(0).Legend = statNm1+' * '+YMetricLevel1; > } > if (statNm2 != "") { > ChartFX1.Series(1).Legend = statNm2+' * '+YMetricLevel2; > } > if (statNm3 != "") { > ChartFX1.Series(2).Legend = statNm3+' * '+YMetricLevel3; > } > ChartFX1.SerLegBoxObj.Docked = TGFP_TOP; > ChartFX1.SerLegBox = true; > if (groupBy == "Mon") dId = "Day"; > else if (groupBy == "Day") dId = "60"; > else if (groupBy == "60") dId = "30"; > else if (groupBy == "30") dId = "15"; > else if (groupBy == "15") dId = "05"; > if (groupBy != "05") { > ChartFX1.URLParamMask = > "dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S"; > ChartFX1.URL(0) = "sst_graph_out.asp"; > ChartFX1.URL(1) = "sst_graph_out.asp"; > ChartFX1.URL(2) = "sst_graph_out.asp"; > ChartFX1.URLOptions = CHART_URL_JUMP || CHART_URL_PARAM; > ChartFX1.URLTarget = "_blank"; > ChartFX1.DblClk(CHART_URLCLK,0); > } > > %> > <% > ChartFX1.ToolBar = true; > ChartFX1.ToolBarObj.Visible = true; > if (ChartGenType == "Auto") { > > Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10)) > ) > } > else { > > Response.Write(ChartFX1.GetHtmlTag(parseInt(gWidth,10),parseInt(gHeight,10), > "Image")) > } > %> > </body> > <% // VI 6.0 Scripting Object Model Enabled %> > <% EndPageProcessing() %> > </form> > </html> > > > > ----- Original Message ----- > From: "SoftwareFX Support" <support@softwarefx.com> > Newsgroups: chartfx.internet.55 > Sent: Friday, November 14, 2003 9:25 AM > Subject: Re: No Legend when creating image > > > > I took you code and modify it so that it will run in my server. > > > > By the way, what scripting language is your code in ? JavaScript ? I > wasn't > > sure. > > > > I translated it to VB script and run it. I got good results for both the > > Image and the ActiveX. Are you using the latest SP ? please check in our > > support site. > > > > Here is the modified code, please try it in a separate ASP and let me know > > what you get. > > > > <HTML> > > <HEAD> > > </HEAD> > > <BODY bgcolor="F0FFFF"> > > <!-- #include virtual="/Include/CfxIE.inc" --> > > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > > <!-- #include virtual="/Include/CfxIECmds.inc" --> > > > > <% > > Set ChartFX1 = Server.CreateObject("ChartFX.WebServer") > > Set CfxArray = Server.CreateObject("CfxData.Array") > > > > Dim XDate(3) > > XDate(0) = "a" > > XDate(1) = "b" > > XDate(2) = "c" > > Dim YMetric1(3) > > YMetric1(0) = 10 > > YMetric1(1) = 20 > > YMetric1(2) = 30 > > > > CfxArray.AddArray(XDate) > > CfxArray.AddArray(YMetric1) > > ChartFX1.DataType(1) = CDT_VALUE > > if (numOfMetrics >= 2) then > > CfxArray.AddArray(YMetric2) > > ChartFX1.DataType(2) = CDT_VALUE > > end if > > if (numOfMetrics = 3) then > > CfxArray.AddArray(YMetric3) > > ChartFX1.DataType(3) = CDT_VALUE > > end if > > ChartFX1.GetExternalData(CfxArray) > > > > if (numOfMetrics = 1) Then > > ChartFX1.Series(0).Legend = statNm1 > > else > > ChartFX1.Series(0).Legend = statNm1+" * "+YMetricLevel1 > > end if > > if (statNm2 <> "") then > > // Response.Write("<br>numbertwo<br>"+statNm2) > > ChartFX1.Series(1).Legend = statNm2+"* "+YMetricLevel2 > > end if > > if (statNm3 <> "") then > > // Response.Write("<br>numberthree<br>"+statNm3) > > ChartFX1.Series(2).Legend = statNm3+" * "+YMetricLevel3 > > end if > > ChartFX1.SerLegBoxObj.Docked = TGFP_TOP > > ChartFX1.SerLegBox = true > > if (groupBy = "Mon") then > > dId = "Day" > > else > > if (groupBy = "Day") then > > dId = "60" > > else > > if (groupBy = "60") then > > dId = "30" > > else > > if (groupBy = "30") then > > dId = "15" > > else > > if (groupBy = "15") then > > dId = "05" > > end if > > end if > > end if > > end if > > end if > > > > if (groupBy <> "05") then > > ChartFX1.URLParamMask > > ="dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S" > > ChartFX1.URL(0) = "sst_graph_out.asp" > > ChartFX1.URL(1) = "sst_graph_out.asp" > > ChartFX1.URL(2) = "sst_graph_out.asp" > > ChartFX1.URLOptions = CHART_URL_JUMP or CHART_URL_PARAM > > ChartFX1.URLTarget = "_blank" > > ChartFX1.DblClk CHART_URLCLK,0 > > end if > > ChartFX1.ToolBar = true > > ChartFX1.ToolBarObj.Visible = true > > If (ChartGenType = "Auto") Then > > > > Response.Write(ChartFX1.GetHtmlTag(300,300)) > > else > > > > Response.Write(ChartFX1.GetHtmlTag(300,300,"Image")) > > end if > > > > > > %> > > <br> > > > > > > </BODY> > > </HTML> > > > > > > -- > > FP > > Software FX, Inc. > > > > > "SoftwareFX Support" <support@softwarefx.com> wrote in message > news:wXUGVOsqDHA.1896@WEBSERVER1... > > I took you code and modify it so that it will run in my server. > > > > By the way, what scripting language is your code in ? JavaScript ? I > wasn't > > sure. > > > > I translated it to VB script and run it. I got good results for both the > > Image and the ActiveX. Are you using the latest SP ? please check in our > > support site. > > > > Here is the modified code, please try it in a separate ASP and let me know > > what you get. > > > > <HTML> > > <HEAD> > > </HEAD> > > <BODY bgcolor="F0FFFF"> > > <!-- #include virtual="/Include/CfxIE.inc" --> > > <!-- #include virtual="/Include/CfxIEExtra.inc" --> > > <!-- #include virtual="/Include/CfxIECmds.inc" --> > > > > <% > > Set ChartFX1 = Server.CreateObject("ChartFX.WebServer") > > Set CfxArray = Server.CreateObject("CfxData.Array") > > > > Dim XDate(3) > > XDate(0) = "a" > > XDate(1) = "b" > > XDate(2) = "c" > > Dim YMetric1(3) > > YMetric1(0) = 10 > > YMetric1(1) = 20 > > YMetric1(2) = 30 > > > > CfxArray.AddArray(XDate) > > CfxArray.AddArray(YMetric1) > > ChartFX1.DataType(1) = CDT_VALUE > > if (numOfMetrics >= 2) then > > CfxArray.AddArray(YMetric2) > > ChartFX1.DataType(2) = CDT_VALUE > > end if > > if (numOfMetrics = 3) then > > CfxArray.AddArray(YMetric3) > > ChartFX1.DataType(3) = CDT_VALUE > > end if > > ChartFX1.GetExternalData(CfxArray) > > > > if (numOfMetrics = 1) Then > > ChartFX1.Series(0).Legend = statNm1 > > else > > ChartFX1.Series(0).Legend = statNm1+" * "+YMetricLevel1 > > end if > > if (statNm2 <> "") then > > // Response.Write("<br>numbertwo<br>"+statNm2) > > ChartFX1.Series(1).Legend = statNm2+"* "+YMetricLevel2 > > end if > > if (statNm3 <> "") then > > // Response.Write("<br>numberthree<br>"+statNm3) > > ChartFX1.Series(2).Legend = statNm3+" * "+YMetricLevel3 > > end if > > ChartFX1.SerLegBoxObj.Docked = TGFP_TOP > > ChartFX1.SerLegBox = true > > if (groupBy = "Mon") then > > dId = "Day" > > else > > if (groupBy = "Day") then > > dId = "60" > > else > > if (groupBy = "60") then > > dId = "30" > > else > > if (groupBy = "30") then > > dId = "15" > > else > > if (groupBy = "15") then > > dId = "05" > > end if > > end if > > end if > > end if > > end if > > > > if (groupBy <> "05") then > > ChartFX1.URLParamMask > > ="dId="+dId+"&sId="+statIdInList+"&date=%l&sIdx=%S" > > ChartFX1.URL(0) = "sst_graph_out.asp" > > ChartFX1.URL(1) = "sst_graph_out.asp" > > ChartFX1.URL(2) = "sst_graph_out.asp" > > ChartFX1.URLOptions = CHART_URL_JUMP or CHART_URL_PARAM > > ChartFX1.URLTarget = "_blank" > > ChartFX1.DblClk CHART_URLCLK,0 > > end if > > ChartFX1.ToolBar = true > > ChartFX1.ToolBarObj.Visible = true > > If (ChartGenType = "Auto") Then > > > > Response.Write(ChartFX1.GetHtmlTag(300,300)) > > else > > > > Response.Write(ChartFX1.GetHtmlTag(300,300,"Image")) > > end if > > > > > > %> > > <br> > > > > > > </BODY> > > </HTML> > > > > > > -- > > FP > > Software FX, Inc. > > > > > > Link to comment Share on other sites More sharing options...
Software FX Posted November 17, 2003 Report Share Posted November 17, 2003 The original line is OK. However, setting CHART_PRS_SEPARATE_LEGEND will omit the legend when drawing the chart to a device context whether it is an image or the printer. You must omit this line if you are generating images. The constants are obsolete. Instead you must use the corresponding properties: ChartFX1.Printer.ForceColors = true; ChartFX1.Printer.SeparateLegend = true; -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 17, 2003 Author Report Share Posted November 17, 2003 Thanks for the clarification. I get it now. I appreciate all the help! Great product by the way... Joel "SoftwareFX Support" <support@softwarefx.com> wrote in message news:jm1sETSrDHA.1560@WEBSERVER1... > The original line is OK. However, setting CHART_PRS_SEPARATE_LEGEND will > omit the legend when drawing the chart to a device context whether it is an > image or the printer. > > You must omit this line if you are generating images. > > The constants are obsolete. Instead you must use the corresponding > properties: > > ChartFX1.Printer.ForceColors = true; > ChartFX1.Printer.SeparateLegend = true; > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.