Re: Charts in A5?
Ok, I understand. Look at #33, because its not good for me to use that.
Ok, I understand. Look at #33, because its not good for me to use that.
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
Sub DoTheChart() Dim nRetval AS LONG Dim sTemp AS STRING With RMChartX1 .Reset .RMCBackColor = AliceBlue .RMCStyle = RMC_CTRLSTYLEFLAT .RMCWidth = 600 .RMCHeight = 450 .RMCBgImage = "" .Font = "Tahoma" .RMCToolTipWidth = 0 .RMCHelpingGridSize = 0 .RMCHelpingGridColor = Default .RMCBitmapColor = Default '************** Add Region 1 ***************************** .AddRegion With .Region(1) .Left = 5 .Top = 5 .Width = -5 .Height = -5 .Footer = "" '************** Add caption to region 1 ******************* .AddCaption With .Caption .Titel = "This is the chart's caption" .BackColor = Blue .TextColor = Yellow .FontSize = 11 .Bold = TRUE End With 'Caption '************** Add grid to region 1 ***************************** .AddGrid With .Grid .BackColor = White .AsGradient = FALSE .BicolorMode = RMC_BICOLOR_LABELAXIS .Left = 0 .Top = 0 .Width = 0 .Height = 0 End With 'Grid '************** Add data axis to region 1 ***************************** .AddDataAxis With .DataAxis(1) .Alignment = RMC_DATAAXISLEFT .MinValue = 0 .MaxValue = 100 .TickCount = 11 .Fontsize = 8 .TextColor = Black .LineColor = Black .LineStyle = RMC_LINESTYLESOLID .DecimalDigits = 0 .AxisUnit = "" .AxisText = "" End With 'DataAxis(1) '************** Add label axis to region 1 ***************************** .AddLabelAxis With .LabelAxis .AxisCount = 1 .TickCount = 5 .Alignment = RMC_LABELAXISBOTTOM .Fontsize = 8 .TextColor = Black .TextAlignment = RMC_TEXTCENTER .LineColor = Black .LineStyle = RMC_LINESTYLENONE .AxisText = "" sTemp = "Label 1*Label 2*Label 3*Label 4*Label 5" .LabelString = sTemp End With 'LabelAxis '************** Add Series 1 to region 1 ******************************* .AddBarSeries With .BarSeries(1) .SeriesType = RMC_BARSINGLE .SeriesStyle = RMC_BAR_FLAT_GRADIENT2 .Lucent = FALSE .Color = Default .Horizontal = FALSE .WhichDataAxis = 1 .ValueLabelOn = RMC_VLABEL_NONE .PointsPerColumn = 1 .HatchMode = RMC_HATCHBRUSH_OFF '****** Set data values ****** sTemp = "50*70*40*60*30" .DataString = sTemp End With 'BarSeries(1) End With 'Region(1) nRetVal = .Draw(TRUE) End With 'RMChartX1 END SUB
'Date Created: 09-Sep-2007 02:52:05 PM 'Last Updated: 09-Sep-2007 09:15:50 PM 'Created By : Marcel Kollenaar 'Updated By : Marcel Kollenaar 'This code is translated from the code generator RMCDesigner. 'Code can be exported as VB6, PowerBasic or .Net 'The program can be downloaded at [URL]http://www.rmchart.com[/URL] 'The RMCHart program is free. dim chart as p dim region as P constant Default = 0 constant RMC_CTRLSTYLEFLAT = 0 constant RMC_CTRLSTYLEFLATSHADOW = 1 constant RMC_CTRLSTYLE3D = 2 constant RMC_CTRLSTYLE3DLIGHT = 3 constant RMC_CTRLSTYLEIMAGE = 4 constant RMC_CTRLSTYLEIMAGETILED = 5 constant RMC_BICOLOR_NONE = 0 constant RMC_BICOLOR_DATAAXIS = 1 constant RMC_BICOLOR_LABELAXIS = 2 constant RMC_BICOLOR_BOTH = 3 constant RMC_DATAAXISLEFT = 1 constant RMC_DATAAXISRIGHT = 2 constant RMC_DATAAXISTOP = 3 constant RMC_DATAAXISBOTTOM = 4 constant RMC_LABELAXISLEFT = 5 constant RMC_LABELAXISRIGHT = 6 constant RMC_LABELAXISTOP = 7 constant RMC_LABELAXISBOTTOM = 8 constant RMC_BAR_FLAT = 1 constant RMC_BAR_FLAT_GRADIENT1 = 2 constant RMC_BAR_FLAT_GRADIENT2 = 3 constant RMC_BAR_HOVER = 4 constant RMC_COLUMN_FLAT = 5 constant RMC_BAR_3D = 6 constant RMC_BAR_3D_GRADIENT = 7 constant RMC_COLUMN_3D = 8 constant RMC_COLUMN_3D_GRADIENT = 9 constant RMC_BARSINGLE = 1 constant RMC_BARGROUP = 2 constant RMC_BARSTACKED = 3 constant RMC_BARSTACKED100 = 4 constant RMC_FLOATINGBAR = 5 constant RMC_FLOATINGBARGROUP = 6 constant RMC_VLABEL_NONE = 0 constant RMC_VLABEL_DEFAULT = 1 constant RMC_VLABEL_PERCENT = 5 constant RMC_VLABEL_ABSOLUTE = 6 constant RMC_VLABEL_TWIN = 7 constant RMC_VLABEL_LEGENDONLY = 8 constant RMC_VLABEL_DEFAULT_NOZERO = 11 constant RMC_VLABEL_PERCENT_NOZERO = 15 constant RMC_VLABEL_ABSOLUTE_NOZERO = 16 constant RMC_VLABEL_TWIN_NOZERO = 17 constant RMC_HATCHBRUSH_OFF = 0 constant RMC_HATCHBRUSH_ON = 1 constant RMC_HATCHBRUSH_ONPRINTING = 2 constant RMC_LINESTYLESOLID = 0 constant RMC_LINESTYLEDASH = 1 constant RMC_LINESTYLEDOT = 2 constant RMC_LINESTYLEDASHDOT = 3 constant RMC_LINESTYLENONE = 5 constant RMC_TEXTCENTER = 0 constant RMC_TEXTLEFT = 1 constant RMC_TEXTRIGHT = 2 'debug(1) chart := ACTIVEX1.activex.this chart.Reset() 'Colors produced by A5 as rgb:ebffff nust be switched to bgr: ffffeb chart.RMCBackColor = hex_to_dec("ffffeb") chart.RMCStyle = RMC_CTRLSTYLEFLAT chart.RMCWidth = 600 chart.RMCHeight = 450 'chart.RMCBgImage = "" chart.Font.name = "Tahoma" chart.RMCToolTipWidth = 0 chart.RMCHelpingGridSize = 0 chart.RMCHelpingGridColor = Default chart.RMCBitmapColor = Default '************** Add Region 1 ************************************ chart.AddRegion() region := chart.region(1) region.footer= "" region.Left = 10 region.Top = 10 region.Width = -5 region.Height = -5 region.Footer = "This is a footer" '************** Add caption to region 1 ************************* region.addcaption() region.caption.titel = "Titel of this chart" region.caption.BackColor = hex_to_dec("ff0000") region.caption.TextColor = hex_to_dec("00ffff") region.caption.FontSize = 11 region.caption.Bold = .T. '************** Add grid to region 1 ***************************** region.AddGrid() region.grid.BackColor = hex_to_dec("ffffff") region.grid.AsGradient = .F. region.grid.BicolorMode = RMC_BICOLOR_LABELAXIS region.grid.Left = 0 region.grid.Top = 0 region.grid.Width = 0 region.grid.Height = 0 '************** Add data axis to region 1 ***************************** region.AddDataAxis() region.DataAxis(1).Alignment = RMC_DATAAXISLEFT region.DataAxis(1).MinValue = 0 region.DataAxis(1).MaxValue = 100 region.DataAxis(1).TickCount = 11 region.DataAxis(1).Fontsize = 8 region.DataAxis(1).TextColor = hex_to_dec("000000") region.DataAxis(1).LineColor = hex_to_dec("000000") region.DataAxis(1).LineStyle = RMC_LINESTYLESOLID region.DataAxis(1).DecimalDigits = 1 region.DataAxis(1).AxisUnit = "" region.DataAxis(1).AxisText = "" '************** Add label axis to region 1 ***************************** region.AddLabelAxis() region.LabelAxis.AxisCount = 1 region.LabelAxis.TickCount = 5 region.LabelAxis.Alignment = RMC_LABELAXISBOTTOM region.LabelAxis.Fontsize = 8 region.LabelAxis.TextColor = hex_to_dec("000000") region.LabelAxis.TextAlignment = RMC_TEXTCENTER region.LabelAxis.LineColor = hex_to_dec("000000") region.LabelAxis.LineStyle = RMC_LINESTYLENONE region.LabelAxis.AxisText = "" sTemp = "Label 1*Label 2*Label 3*Label 4*Label 5" region.LabelAxis.LabelString = sTemp '************** Add Series 1 to region 1 ******************************* region.AddBarSeries() region.BarSeries(1).SeriesType = RMC_BARSINGLE region.BarSeries(1).SeriesStyle = RMC_BAR_FLAT_GRADIENT2 region.BarSeries(1).Lucent = .F. region.BarSeries(1).Color = 0 region.BarSeries(1).Horizontal = .F. region.BarSeries(1).WhichDataAxis = 1 region.BarSeries(1).ValueLabelOn = RMC_VLABEL_NONE region.BarSeries(1).PointsPerColumn = 1 region.BarSeries(1).HatchMode = RMC_HATCHBRUSH_OFF '****** Set data values ****** Dim aData[1..5] As n aData[1] = 40 aData[2] = 10 aData[3] = 30 aData[4] = 20 aData[5] = 80 For i = 1 To 5 region.barseries(1).SetDataValue(i, aData[i]) next a = chart.draw() if a = 0 then 'ui_msg_box("","Succes") else ui_msg_box("","Error: " + str(a)) end if end
Dim Chart as P Dim sData as C [COLOR=Blue]'The code below in green is the formatted string output by the chart designer.[/COLOR] [COLOR=Green] sData = sData + "00003600|00004600|000052|000061|00009401|00011Tahoma|100011|100035|100045|10005-" sData = sData + "5|10006250|1000910|100101|100111|100181|100200|1002120|1002211|100238|100331|100" sData = sData + "341|100355|100378|100481|100541|100558|10063-1|100652|110011|110021|110049|11012" sData = sData + "1|110131|1102111|110221|110235|110281|110532*4*6*8*10|200011|200035|20004250|200" sData = sData + "05-5|20006-5|2000910|200101|200181|200468|200481|200634|200652|210011|2100251|21" sData = sData + "00454|210127|210161|21018-1|210211|210221|210234|21051-256*-15132304*-16737997*-" sData = sData + "65536|210531*1*1*1"[/COLOR] chart := ACTIVEX1.activex.this chart.Reset() chart.RMCFile = sData chart.draw()
Dim Chart as P Dim sData as C t=table.current() sData = sData + "00003600|00004600|000052|000061|00009401|00011Tahoma|100011|100035|100045|10005-" sData = sData + "5|10006250|1000910|100101|100111|100181|100200|1002120|1002211|100238|100331|100" sData = sData + "341|100355|100378|100481|100541|100558|10063-1|100652|110011|110021|110049|11012" sData = sData + "1|110131|1102111|110221|110235|110281|11053" sData = sData + t.bar1+"*"+t.bar2+"*"+t.bar3+"*"+t.bar4+"*"+t.bar5 sData = sData + "|200011|200035|20004250|200" sData = sData + "05-5|20006-5|2000910|200101|200181|200468|200481|200634|200652|210011|2100251|21" sData = sData + "00454|210127|210161|21018-1|210211|210221|210234|21051-256*-15132304*-16737997*-" sData = sData + "65536|210531*1*1*1" chart := ACTIVEX1.activex.this chart.Reset() chart.RMCFile = sData chart.draw()
Comment