Uses 180K of libraries. Click here for Pure Java version (6826L/45K/154K).
!7 lib 1001955 // charts4j import com.googlecode.charts4j.*; import static com.googlecode.charts4j.Color.*; import static com.googlecode.charts4j.Shape.*; import static com.googlecode.charts4j.UrlUtil.normalize; import com.googlecode.charts4j.Color; p { botIfMain(); } answer { if "cpu meter" exceptionToUser { double percent = (double) call(getBot("#1001405"), "getInProcessCPU"); GoogleOMeter chart = GCharts.newGoogleOMeter(percent, "Utilized", "In-Java CPU Percentage", Color.newColor("1148D4"), Color.newColor("5766DE"), Color.newColor("DB3270"), Color.newColor("D41111")); chart.setTitle("Eleu CPU", BLACK, 14); chart.setSize(400, 200); final LinearGradientFill fill = Fills.newLinearGradientFill(0, BLUE, 100); fill.addColorAndOffset(RED, 0); chart.setBackgroundFill(fill); chart.setAreaFill(Fills.newSolidFill(Color.newColor(GRAY, 70))); String url = chart.toURLString(); ret returnImage(url); } } static S returnImage(S imageURL) { // TODO: caching /* byte[] data = loadBinaryPage(imageURL); S md5 = md5(data); S fileName = "chart-" + md5 + ".png"; saveBinaryFile(getProgramFile(fileName), data); S newURL = "bots.tinybrain.de/" + getProgramID() + "/raw/" + fileName; ret "Lookie here: " + newURL;*/ imageURL = urlShortener(imageURL); ret "Lookie here: " + imageURL; }
Began life as a copy of #1002496
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, vpdwwinrgdga
No comments. add comment