Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Hi there, I am trying to find out what chart to use to be ab...


Glen Co

Recommended Posts

Hi there,

I am trying to find out what chart to use to be able to display a bar or line chart of daily data but displayed in by month. Like the covid charts. IBI support has recommended the DyGraph but I could not find any useful documentation to be able to customize it.

(Covid Chart)

Do you have any recommendation Can the default line chart in IBI be used

Thank you

Glen

Link to comment
Share on other sites

Try running this code.

DEFINE FILE ibisamp/ggsales

DateYYMD/YYMD = AYMD(&DATEH8,-SEQ_NO,'I8YYMD');

DateMt/Mt = DateYYMD;

LAST1UNITS/I9 = LAST UNITS;

LAST2UNITS/I9 = LAST LAST1UNITS;

LAST3UNITS/I9 = LAST LAST2UNITS;

MAUNITS/I9 = (LAST3UNITS + LAST2UNITS + LAST1UNITS + UNITS ) / 4;

END

 

GRAPH FILE ibisamp/ggsales

SUM UNITS AS 'Cases'

MAUNITS AS '4-Day'

BY DateYYMD NOPRINT

BY DateMt

WHERE READLIMIT IS 250

ON GRAPH PCHOLD FORMAT JSCHART

ON GRAPH SET LOOKGRAPH BAR

ON GRAPH SET AUTOFIT ON

ON GRAPH SET STYLE *

TYPE=REPORT, CHART-SERIES-LAYOUT=stacked, $

TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $

TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $

TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $

TYPE=DATA, COLUMN=N4, BUCKET=y-axis, $

*GRAPH_SCRIPT

setSeriesType(1,2);

setSmoothLines(true);

setMarkerShape(getSeries(*),0);

setFillColor(getSeries(0),new Color(#90bbbb));

setFillColor(getSeries(1),new Color(#002874));

setTransparentBorderColor(getChartBackground(),true);

setTransparentBorderColor(getSeries(*), true);

setTransparentBorderColor(getFrame(),true);

setDisplay(getO1MajorTick(),false);

setSkipCount(getO1Label(),30);

setTextRotation(getO1Label(),0);

setFillColor(getO1Label(),new Color(128,128,128));

setDisplay(getO1MajorGrid(),false);

setFontName(getO1Label(),"arial");

setFontSizeAbsolute(getO1Label(),true);

setFontSizeInPoints(getO1Label(),12);

setPlaceResize(getO1Label(), 0);

setDisplay(getY1MajorTick(),false);

setFontName(getY1Label(),"arial");

setFontSizeAbsolute(getY1Label(),true);

setFontSizeInPoints(getY1Label(),12);

*GRAPH_JS_FINAL

xaxis: {title: {visible: false} },

yaxis: {title: {visible: false},

majorGrid: {visible:true,

lineStyle: { width: 1,

color:'silver'}

}

}

*END

ENDSTYLE

END

Link to comment
Share on other sites

@david.beagan

Hi David,

Just wanted to let you know that the sample code you attached led me to a solution I was looking for. You are a genius!. I found out that the default theme I was using was preventing me from displaying the daily data into monthly. I did not have to use defines on my date, but I had to insert the date field twice into the by section and set the other to noprint just like in your example. And everything works perfectly now.

I was trying to use the dyGraph but for some reason, it is doing its own calculation and i cannot figure it out. The totals in the graph dont match the table.

But with your example, i was able to use just the default line graph in webfocus. Thank you, thank you, thank you

Glen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...