![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | |
jtillia
Beta Tester
Joined: August 03 2004 Location: United States Status: Offline Points: 67 |
Post Options
Thanks(0)
Quote Reply
Topic: script with APIPosted: March 29 2006 at 12:33pm |
|
We use this item to make charts:
I have made a script such as: EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25) * * * Initialize and create SCR = \Dim chart As Object\ scr = scr:em:\dim data as variant\ scr = scr:em:\dim labels as variant\ * scr = scr:em:\Set Chart = CreateObject("ChartDirector.API")\ scr = scr:em:\data = Array(85, 156, 179.5, 211, 123)\ scr = scr:em:\labels = Array("Mon", "Tue", "Wed", "Thu", "Fri")\ scr = scr:em:\area = Array(30,20,200,200)\ scr = scr:em:\with chart\ scr = scr:em:\ .XYChart(250, 250)\ scr = scr:em:\ .XYChart.setPlotArea(30,20,200,200)\ scr = scr:em:\ .XYChart.addBarLayer = data\ scr = scr:em:\ .XYChart.xAxis().setLabels = labels\ scr = scr:em:' .XYChart.makeChart = "c:\tmp\Testbar.jpg"' scr = scr:em:'End with' * * * SCR = SCR:EM:\chart.Application.Quit\ SCR = SCR:EM:\Set chart = Nothing\ * * * PRINT ESC:STX:'P':SCR:CR: stop This does not work. Here is the VB script that works with the API Set cd = CreateObject("ChartDirector.API") 'The data for the bar chart data = Array(85, 156, 179.5, 211, 123) 'The labels for the bar chart labels = Array("Mon", "Tue", "Wed", "Thu", "Fri") 'Create a XYChart object of size 250 x 250 pixels Set c = cd.XYChart(250, 250) 'Set the plotarea at (30, 20) and of size 200 x 200 pixels Call c.setPlotArea(30, 20, 200, 200) 'Add a bar chart layer using the given data Call c.addBarLayer(data) 'Set the x axis labels using the given labels Call c.xAxis().setLabels(labels) 'output the chart in PNG format Call c.makeChart("simplebar.png") I have changed the file name, but my script does not work. Anyone with any ideas. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |