Page 1 of 1

DCRMCHART

Posted: Wed Aug 03, 2016 11:36 pm
by c-tec
Hello Roger,
Hallo,
DCRMCHART is very helpful for me, but get in my attached sample only a empty dialog and connot finde the problem. Can you see anything wrong ?
In my latest eXpress++ version some samples in RMCHART.EXE do not work, get for example in Grid based -> grouped bars, a "type conflict" in "setproperties" in _GROUPEDBARS(235)

regards
Rudolf

Code: Select all

static function bargroup1(aDataM,aDataW,cFilename)
******************************************************************
local getlist := {},oRMChart,aBarGroup := {},aDataAxis1 := {},oRegion1,aAxis := {},nMaxM := 0,nMaxW := 0,nMax,nTmp,nAxis
ALTD()

aDataM := {100,200, 30, 40, 30, 30, 60, 10, 100,250}
aDataW := { 50, 10,200, 30, 50, 80, 20, 60,  70, 90}
cFilename := "test.jpg"


nMaxM := maxval(aDataM)
nMaxW := maxval(aDataW)
nMax := max(nMaxW,nMaxM)
nTmp := int(nMax/10)
nAxis := 0
for x := 1 to 10
     aadd(aAxis,ntrim(nAxis))
     nAxis += nTmp
next x

@ 0,0 DCRMCHART oRmChart SIZE 600, 450 PIXEL

DcAddBarGroup TO aBarGroup DATA aDataM TYPE RMC_BARGROUP COLOR CornflowerBlue
DcAddBarGroup TO aBarGroup DATA aDataW TYPE RMC_BARGROUP COLOR Gold
DcAddDataAxis TO aDataAxis1 LABELTEXT aAxis

@ 0,0 DcChartRegion oRegion1 ;
   PARENT oRMChart ;
   FOOTER "RM chart test" ;
   SIZE 600, 400 PIXEL ;
   CAPTION TITLE 'Title' ;
   GRID ;
   LEGEND TEXT { 'male', 'female' } ;
   DATAAXIS aDataAxis1 ;
   LABELAXIS LABELARRAY { "0-2","3-5","6-13","14-17","18-20","21-24","25-34","35-49","50-64","65 and older" } ;
   BARGROUP aBarGroup
dcread gui fit
return .t.

Re: DCRMCHART

Posted: Thu Aug 04, 2016 1:42 am
by c-tec
Hello Roger,
found it ! I did not call the draw() Method.
Now I only have a little problem with the bars, they do not fit compard to the axis, they ar going to the top of the chart window between the upper lables. Its the result from the sample I sent bevore. How can i change this behaviour ?
regards
Rudolf

Re: DCRMCHART

Posted: Thu Aug 04, 2016 6:01 am
by rdonnay
Make the changes as shown below marked with <<<<<<<

Code: Select all

for x := 1 to 11  <<<<<<<
     aadd(aAxis,ntrim(nAxis))
     nAxis += nTmp
next x

@ 0,0 DCRMCHART oRmChart SIZE 600, 450 PIXEL

DcAddBarGroup TO aBarGroup DATA aDataM TYPE RMC_BARGROUP COLOR CornflowerBlue
DcAddBarGroup TO aBarGroup DATA aDataW TYPE RMC_BARGROUP COLOR Gold
DcAddDataAxis TO aDataAxis1 LABELTEXT aAxis TICKCOUNT 11 MINVALUE 0 MAXVALUE 250 <<<<<<<<

Re: DCRMCHART

Posted: Fri Aug 05, 2016 1:30 am
by c-tec
Hello Roger,
did not change the result. Attached a small sample and a screenshot. I have now moved the highest columns in the middle to see the effect better.
regards
Rudolf

Code: Select all

static function bargroup1()
******************************************************************
local getlist := {},oRMChart,aBarGroup := {},aDataAxis1 := {},oRegion1,aAxis := {},aDataM,aDataW

aDataM := { 30,200, 30, 40,250, 30, 60, 10, 100,250}
aDataW := { 50, 10,200, 30,240, 80, 20, 60,  70, 90}
aAxis  := {"1" ,"2","3","4","5","6","7","8","9","10","11"}
@ 0,0 DCRMCHART oRmChart SIZE 600, 450 PIXEL

DcAddBarGroup TO aBarGroup DATA aDataM TYPE RMC_BARGROUP COLOR CornflowerBlue
DcAddBarGroup TO aBarGroup DATA aDataW TYPE RMC_BARGROUP COLOR Gold
DcAddDataAxis TO aDataAxis1 LABELTEXT aAxis

@ 0,0 DcChartRegion oRegion1 ;
   PARENT oRMChart ;
   FOOTER "RM chart test" ;
   SIZE 600, 400 PIXEL ;
   CAPTION TITLE 'Title' ;
   GRID ;
   LEGEND TEXT { 'male', 'female' } ;
   DATAAXIS aDataAxis1 ;
   LABELAXIS LABELARRAY { "1","2","3","4","5","6","7","8","9","10" } ;
   BARGROUP aBarGroup

dcread gui fit EVAL {||oRmChart:draw()}

return .t.


Re: DCRMCHART

Posted: Fri Aug 05, 2016 3:01 am
by Wolfgang Ciriack
Hi Rudolf,
you did not change this line

Code: Select all

DcAddDataAxis TO aDataAxis1 LABELTEXT aAxis TICKCOUNT 11 MINVALUE 0 MAXVALUE 250 <<<<<<<<

Re: DCRMCHART

Posted: Fri Aug 05, 2016 4:16 am
by c-tec
Hello Wolfgang,
thank you, it works now perfect ! I should take a closer look at the include file and the samples. It's fascinating what you can do with a few lines of eXpress++ code and RMCHART.
regards
Rudolf