KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Changing the Thickness of Graphed Lines in 4D Chart
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: July 28, 2000
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In 4D Chart, you cannot alter the thickness of lines in nearly all of the 2D graph types. An easy workaround for the Macintosh platform is to use a 3D Line graph (type 101) instead. Using the CT SET 3D VIEW command, configure the 3D graph so the view is directly from the front: CT SET 3D VIEW (Area;$Chart;0;0). At this perspective, the 3D effect is completely hidden, making it look like a 2D graph. In a 3D graph, the CT SET CHART LINE ATTRIBUTES command enables you to specify the line thickness of your graph curves. However, on the Windows platform, thickened lines in a 3D Line graph are not centered on the points they connect -- the thickness is off to one side.

On Windows, the only graph type in which thick lines draw centered over the data points is the 2D XY graph. (But if you display this graph type on a Macintosh, the thickened lines draw off-center.) In a 2D XY graph, you can use the CT SET CHART LINE ATTRIBUTES command to set the thickness of the graph curve lines. This is a more complicated workaround than using a 3D Line graph, because creating a line graph using the 2D XY graph requires that your Series and Values arrays be configured with twice as many elements as they otherwise would be. (I'd recommend you write a code loop that converts your standard Series and Values arrays into a separate pair of arrays in this format, so you can easily display your original arrays as different graph types.) For more information on configuring the arrays for a 2D XY Graph, see my Technical Note 98-27, "Converting the GRAPH Commands to 4D Chart".

On Macintosh, thickened lines in a 2D XY graph are thickened on one side from the center of the points. If your lines aren't very thick, you can make this less obvious by hiding the point shapes (with the "CT SET CHART OPTIONS" command).