Graphics Server Technologies: Graphs and Charts for the World
 

Support
Knowledge Base
Sample Code
Column Articles
Support Plans
Current Service Packs
Older Service Packs
Developer FAQ

Home / Support / Developer FAQ

Graphics Server FAQ - Frequently Asked Questions

    Questions

  1. What files do I need to distribute to other machines to run Graphics Server?
  2. How do I install the DTC, the web-based implementation, and set up my server?
  3. Do I need to purchase the DTC to get graphs on my web pages?
  4. Is there a basic example of using the DTC to get graphs on my web page?
  5. Is there documentation for the DTC?
  6. I'm setting properties of the graph control, but my settings aren't being shown.
  7. How can I get extra text or drawing elements on my graph control?
  8. Why are some graph elements cut from view on-screen, or shown on-screen but not printed?
  9. Why is text so much larger when printing than when displayed on-screen?
  10. Is it better to use the array-referenced properties or their non-array based counterparts?
  11. Why is Extra() and/or XPos() only affecting the first set?
  12. Why does GSMStatus() or SDKPress return wrong mouse status after the first press?
  13. How can I get Thick patterned lines from Graphics Server?
  14. Why do I lose some of my patterns when I print my graph?
  15. Why doesn't PatternData, ColorData, LegendData, or LabelText work for each of my sets?
  16. Why doesn't populating GraphData and XPosData with my recordset work correctly?
  17. How do I convert between my data units and Graphics Server view units?
  18. Can I use the lower level GS calls, found in the Graph Library manual, with the DTC?

    Answers

  1. Question: What files do I need to distribute to other machines to run Graphics Server?
    Answer: Graphics Server's OCX, GraphS32.OCX for the full version of Graphics Server, requires that some Microsoft files get copied and registered on the end-user machine, as well as other Graphics Server files. This knowledge base article details all the necessary files to distribute for versions 5.8 and below of GraphS32.OCX: GSKB197

    If you are using the DTC, our server-side web implementation, you would need to follow this article for the v5.8 files to distribute to each server: GSKB219

    If you have version 6, all files you need to distribute for the GraphS32.OCX are detailed in the Graph Control manual's Appendix C, and the files to distribute for the DTC are detailed in the Graph Web Control manual's Appendix A.

  2. Question: How do I install the DTC, the web-based implementation, and set up my server?
    Answer: This knowledge base article steps through how to setup your server machine, as well as what sample files you can test to see if Graphics Server was installed correctly: GSKB212

  3. Question: Do I need to purchase the DTC to get graphs on my web pages?
    Answer: We recommend purchasing the DTC since this will give you our supported server-side implementation. The core Graphics Server product, without the DTC, comes with a client-side web implementation, which requires the end users to download dependency files, where the DTC doesn't require any extra downloads. This article describes both these situations further: GSKB254

  4. Question: Is there a basic example of using the DTC to get graphs on my web page?
    Answer: The most basic usage of the DTC would entail a Server.CreateObject call through VBScript or JavaScript to load the Graphics Server object. Then graph properties would need to be set in either VBScript or JavaScript, and the last graph property setting would be a DrawGraph() call to create an image file on the server (JPG, PNG, BMP, GIF, etc.). This image file would then be referenced in a standard HTML IMG SRC tag. An example of accomplishing this in VBScript is available in this knowledge base article: GSKB223.

  5. Question: Is there documentation for the DTC?
    Answer: All v5.8 documentation for the DTC is through our knowledge base.
    All documentation for the DTC for version 6.0 or 6.1 is found in the Graphics Server Web Control document included with the product.

    If you want to know what properties and members are available for the DTC, they are very similar to the properties and members available for the graph control. The properties and members that are mentioned in the graph control documentation that aren't available for the DTC are detailed in this knowledge base article: GSKB210
    And the properties and members that are unique to the DTC (not mentioned in the graph control documentation) are detailed here: GSKB222

    All properties and members that are found in the graph control documentation and not mentioned in either of the above two articles will apply to the DTC. The graph control documentation refers to either the HLP files included with our installs for v5.8, or the PDF, RoboHelp, or HTML (CHM) help files included with our installs for v6.0 and v6.1.

  6. Question: I'm setting properties of the graph control, but my settings aren't being shown.
    Answer: You'll need to set the DrawMode to 2 or 3. This serves two purposes. It tells whether the graph should be displayed as a metafile (2) or bitmap (3), and also forces an immediate redraw. None of the properties you've set take effect until the DrawMode is set. When using Graphics Server, you should consider the DrawMode property a Trigger. No matter what it's current setting, you need to set DrawMode to 2 or 3 when you wish your graph control to update. Also, DrawMode = 3 has little to no flicker; you will find it a better redraw mode if updating the graph frequently.

  7. Question: How can I get extra text or drawing elements on my graph control?
    Answer: You can use the lower-level GS calls, found in the Graph Library manual, to draw extra elements on your graph control. We recommend placing all these GS calls into the SDKPaint event so that these GS calls are drawn every time the graph is refreshed with a DrawMode=2 or DrawMode=3 call. This knowledge base article details how to add these GS calls to the graph control GSKB256

  8. Question: Why are some graph elements cut from view on-screen, or shown on-screen but not printed?
    Answer: Graphics Server has a text-spatial algorithm which determines the size of your text objects. When it determines that these objects will either overlap each other, or take up more than 30% of your graphics window, it first tries to reduce their font size. If that does not clear up the spatial problem, it then turns them off in favor of displaying your graph.

    As Graphics Server re-displays your graph in a "hidden" window prior to printing, this sometimes causes a different font determination, and causes Graphics Server to again turn off the text object. As well, if using PrintInfo to print the graph in a different aspect ratio than it displays on screen, it is possible that the new dimensions result in text elements running afoul with the text spatial checks. (For further information, see bulletin GSKB050)

  9. Question: Why is text so much larger when printing than when displayed on-screen?
    Answer: This is due to the Metafile scaling algorithm, not directly related to Graphics Server. Printing is not done directly by Graphics Server; the Metafile is created and passed to Windows for printing, which then scales it. When the text is scaled, it may become too large relative to the rest of your graph. To avoid these scaling effects, try to create your graph as close as possible to the size it will be printed. This article details the scaling issue, and related printing issue, with metafiles further: GSKB050

  10. Question: Is it better to use the array-referenced properties or their non-array based counterparts?
    Answer: Graphics Server several versions back implemented array-referenced properties to simplify property assignment. The old scheme entails using ThisPoint, AutoInc, and IndexStyle, and is Not the scheme we recommend using. While the old non-array-referenced scheme works, it is sometimes difficult to use and is not clear when viewed in code. The older non-array-referenced properties also have a bug when NumSets is greater than NumPoints, so it's best to use the array-referenced properties. See GSKB225 for more info on this.

  11. Question: Why is Extra() and/or XPos() only affecting the first set?
    Answer: Unless you fill values for ALL the sets, Extra(pointNum) and XPos(pointNum) will affect only the first set of data. This is by design. Use ThisSet = setNum to point to different sets.

  12. Question: Why does GSMStatus() or SDKPress return wrong mouse status after the first press?
    Answer: (A more detailed description of this issue is contained in bulletin GSKB172 in this knowledge base.) This is due to the fact that the WM_MOUSEUP message was intercepted by whatever object, or dialog that you placed on top of the Graphics Server object. The best way to have an event fire from a button press would be in the following Code:

    Sub SDKPress(PressStatus as Integer, PressX as double, _
         PressY as Double, PressDataX as double, PressDataY as Double)
    	Static LastPress
    
    	If PressStatus > 0 Then
    		LastPress = PressStatus
    	Else
    		Select Case LastPress
    			Case LastPress = 1
    				LastPress = 0
    				LeftMouse_Sub
    			Case LastPress = 2
    				LastPress = 0
    				MiddleMouse_Sub
    			Case LastPress = 4
    				LastPress = 0
    				RightMouse_Sub
    		End Select
    		LastPress = 0
    	End If
    End Sub
    

  13. Question: How can I get Thick patterned lines from Graphics Server?
    Answer: Graphics Server's drawing functions rely on Windows GDI Functions to generate Line draws. Window's GDI lends no functionality to produce both Thick and Patterned at the same time. The only way to "Fake" the system would be to use GSLineABS() or GSLineRel() do draw "Short" lines in some type of pattern. This is not default behavior of Graphics Server and would require User Programming to accomplish.

  14. Question: Why do I lose some of my patterns when I print my graph?
    Answer: Patterns above 16 are considered "BitMap" patterns. As such, your printer renders them Bit-By-Bit from the fill pattern on the screen. When you send a 96dpi image to a 600dpi printer, it ends up shrinking dramatically. The "Hatch" patterns (0-7) are more successful.

  15. Question: Why doesn't PatternData, ColorData, LegendData, or LabelText work for each of my sets?
    Answer: You need to use the array-referenced versions of these properties. Use Color(setNumber), Pattern(setNumber), Symbol(setNumber), and Legend(setNumber) instead, for multi-set graphs. For single-set bar and pie charts, these properties are referenced by pointNumber. See GSKB225 for more info on the array-referenced properties.

  16. Question: Why doesn't populating GraphData and XPosData with my recordset work correctly?
    Answer: Note: If you are using Graphics Server v6.0 or v6.1, all you need to do to connect to your database is set the ADOData* properties, and point to your data fields - Graphics Server does the rest. An example of this looks like:

    'Database could be Access file, Excel file, SQL connect string, or User DSN
    Graph1.ADODataSource = "Access2000DB.MDB"
    Graph1.ADODataTable = "Accounting"
    
    Graph1.DataField(1) = "JanuaryNumbers"  'assign field to line/set #1
    Graph1.DataField(2) = "FebruaryNumbers" 'assign field to line/set #2
    Graph1.DataField(3) = "MarchNumbers"    'assign field to line/set #3
    

    If you are using Graphics Server v5.8 or prior, you need to connect to the recordset yourself, loop through the database, and assign the Graphics Server properties. If you mis-reference the graph properties, as the example does below, the code to populate GraphData and XPosData doesn't work.
    Example Code:
    Graph1.NumPoints = TB.RecordCount
    TB.MoveFirst
    For I = 1 to Graph1.NumPoints
    	Graph1.ThisPoint = I
    	Graph1.ThisSet = 1
    	Graph1.GraphData = TB!DataValue1
    	Graph1.XPosData = TB!XPosValue1
    	Graph1.ThisSet = 2
    	Graph1.GraphData = TB!DataValue2
    	Graph1.XPosData = TB!XPosValue2
    	Graph1.ThisSet = 3
    	Graph1.GraphData = TB!DataValue3
    	Graph1.XPosData = TB!XPosValue3
    	TB.MoveNext
    Next
    

    For starters, this code is using the old non-array-referenced properties. Here's an example of the correct data assignment using the table in the above code:
    Graph1.NumPoints = TB.RecordCount
    Graph1.NumSets = 3 'Number of unique fields to be plotted
    TB.MoveFirst
    For i = 1 to Graph1.NumPoints
    	Graph1.ThisSet = 1 'Point to set 1
    	Graph1.Data(i) = TB!DataValue1
    	Graph1.XPos(i) = TB!XPosValue1
    
    	Graph1.ThisSet = 2 'Point to set 2
    	Graph1.Data(i) = TB!DataValue2
    	Graph1.XPos(i) = TB!XPosValue2
    
    	Graph1.ThisSet = 3 'Point to set 3
    	Graph1.Data(i) = TB!DataValue3
    	Graph1.XPos(i) = TB!XPosValue3
    
    	TB.MoveNext
    Next i
    

    For more info on using Graphics Server with a recordset object, see GSKB224 .

  17. Question: How do I convert between my data units and Graphics Server view units?
    Answer: The formula is given by:

    Example Code:

    GSValue = DataValue * ScaleFactor + Offset
    DataValue = (GSValue - Offset) / ScaleFactor
    

    There will be independent scaling factors and offsets in the X and Y dimensions. These are:

    Example Code:
    XScaleFactor = SDKInfo(5) / (SDKInfo(1) - SDKInfo(2))
    XOffset = SDKInfo(7)
    
    YScaleFactor = SDKInfo(6) / (SDKInfo(3) - SDKInfo(4))
    YOffset = SDKInfo(8)
    

    There is also an equivalent function AGInfo if you are drawing your graph with AGShow. The index to the
    AGInfo will be one less than the SDKInfo shown above, e.g. AGInfo(0) corresponds to SDKInfo(1). Note that the graph must be displayed before these values are valid, for both SDKInfo and AGInfo. For a longer example of this, please see bulletin GSKB082. (CGraph, like AGInfo, is Zero - Based, and will require reducing the SDKInfo[] return parameters by 1). We have the code for a VB module-based function that handles scaling in articles GSKB110, GSKB111, and GSKB112 .

  18. Question: Can I use the lower level GS calls, found in the Graph Library manual, with the DTC?
    Answer: No, the lower level GS calls are not exposed in the DTC. With the purchase of the DTC, however, we do provide the source code (programmed in VB). You could use the source code to add in the GS calls yourself, and recompile your own web-based DLL. Note, though, that we do not provide support for modifying the source code or modified DLLs. If you have purchased the product and are interested in modifying the source on your own, you can email Support@GraphicsServer.com for details on obtaining the DTC source code.

 

    About Us      Contact      Privacy      Sitemap