Uses 180K of libraries. Click here for Pure Java version (817L/7K/21K).
!759 !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 java.awt.Color; import java.awt.Shape; static S title = "Eleutheria's Popularity!", valuesTitle = "Woot?"; answer { if "test chart" { // Make values final int NUM_POINTS = 25; final double[] values = new double[NUM_POINTS]; for (int i = 0; i < NUM_POINTS; i++) values[i] = (Math.cos(30*i*Math.PI/180)*10 + 50)*i/20; Line line1 = Plots.newLine(Data.newData(values), com.googlecode.charts4j.Color.newColor("CA3D05"), valuesTitle); line1.setLineStyle(LineStyle.newLineStyle(3, 1, 0)); line1.addShapeMarkers(DIAMOND, newColor("CA3D05"), 12); line1.addShapeMarkers(DIAMOND, WHITE, 8); // Defining chart. LineChart chart = GCharts.newLineChart(line1); chart.setSize(600, 450); chart.setTitle(title, WHITE, 14); chart.addHorizontalRangeMarker(40, 60, newColor(RED, 30)); chart.addVerticalRangeMarker(70, 90, newColor(GREEN, 30)); chart.setGrid(25, 25, 3, 2); // Defining axis info and styles AxisStyle axisStyle = AxisStyle.newAxisStyle(WHITE, 12, AxisTextAlignment.CENTER); AxisLabels xAxis = AxisLabelsFactory.newAxisLabels("Nov", "Dec", "Jan", "Feb", "Mar"); xAxis.setAxisStyle(axisStyle); AxisLabels xAxis2 = AxisLabelsFactory.newAxisLabels("2007", "2007", "2008", "2008", "2008"); xAxis2.setAxisStyle(axisStyle); AxisLabels yAxis = AxisLabelsFactory.newAxisLabels("", "25", "50", "75", "100"); AxisLabels xAxis3 = AxisLabelsFactory.newAxisLabels("Month", 50.0); xAxis3.setAxisStyle(AxisStyle.newAxisStyle(WHITE, 14, AxisTextAlignment.CENTER)); yAxis.setAxisStyle(axisStyle); AxisLabels yAxis2 = AxisLabelsFactory.newAxisLabels("Hits", 50.0); yAxis2.setAxisStyle(AxisStyle.newAxisStyle(WHITE, 14, AxisTextAlignment.CENTER)); yAxis2.setAxisStyle(axisStyle); // Adding axis info to chart. chart.addXAxisLabels(xAxis); chart.addXAxisLabels(xAxis2); chart.addXAxisLabels(xAxis3); chart.addYAxisLabels(yAxis); chart.addYAxisLabels(yAxis2); // Defining background and chart fills. chart.setBackgroundFill(Fills.newSolidFill(newColor("1F1D1D"))); LinearGradientFill fill = Fills.newLinearGradientFill(0, newColor("363433"), 100); fill.addColorAndOffset(newColor("2E2B2A"), 0); chart.setAreaFill(fill); String url = chart.toURLString(); ret "Lookie here: " + url; } }
Began life as a copy of #1002469
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment