diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/CsvGraphEngine.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/CsvGraphEngine.scala
index 017ae4ba3..b24f7e652 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/CsvGraphEngine.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/CsvGraphEngine.scala
@@ -32,7 +32,7 @@ class CsvGraphEngine(val name: String, val contentType: String, sep: String) ext
val numberFmt = config.numberFormat
writer.append("\"timestamp\"")
(0 until count).zip(seriesList).map {
- case (i, series) =>
+ case (_, series) =>
val label = "\"%s\"".format(series.data.label)
writer.append(sep).append(label)
}
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ChartSettings.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ChartSettings.scala
index 3c55bd764..ea529f8c1 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ChartSettings.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ChartSettings.scala
@@ -20,10 +20,11 @@ import java.awt.Font
import java.awt.Stroke
import java.awt.image.BufferedImage
import java.util.concurrent.ConcurrentHashMap
-
import com.netflix.atlas.chart.util.Fonts
import com.netflix.iep.config.ConfigManager
+import java.awt.Graphics2D
+
object ChartSettings {
private val config = ConfigManager.dynamicConfig().getConfig("atlas.chart")
@@ -52,7 +53,7 @@ object ChartSettings {
* is created.
*/
val refImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB)
- val refGraphics = refImage.createGraphics()
+ val refGraphics: Graphics2D = refImage.createGraphics()
/** Dashed stroke typically used for grid lines. */
val dashedStroke: Stroke = {
@@ -69,38 +70,38 @@ object ChartSettings {
/**
* Base monospaced font used for graphics. Monospace is used to make the layout easier.
*/
- val monospaceFont = Fonts.loadFont(config.getString("fonts.monospace"))
+ val monospaceFont: Font = Fonts.loadFont(config.getString("fonts.monospace"))
/** Small sized monospaced font. */
- val smallFont = monospaceFont.deriveFont(10.0f)
+ val smallFont: Font = monospaceFont.deriveFont(10.0f)
/** Normal sized monospaced font. */
- val normalFont = monospaceFont
+ val normalFont: Font = monospaceFont
/** Large sized monospaced font. */
- val largeFont = monospaceFont.deriveFont(14.0f)
+ val largeFont: Font = monospaceFont.deriveFont(14.0f)
/** Dimensions for a character using the small font. */
- val smallFontDims = dimensions(smallFont)
+ val smallFontDims: Dimensions = dimensions(smallFont)
/** Dimensions for a character using the normal font. */
- val normalFontDims = dimensions(normalFont)
+ val normalFontDims: Dimensions = dimensions(normalFont)
/** Dimensions for a character using the large font. */
- val largeFontDims = dimensions(largeFont)
+ val largeFontDims: Dimensions = dimensions(largeFont)
/**
* Minimum width required for text elements. Value was chosen to allow typical messages to
* display with a reasonable level of wrapping.
*/
- val minWidthForText = smallFontDims.width * "Warnings: abcdef".length
+ val minWidthForText: Int = smallFontDims.width * "Warnings: abcdef".length
/**
* Minimum width required for text elements. Value was chosen to allow the typical legend with
* stats to show cleanly. It also keeps the cutoff below the level of sizes that are frequently
* used in practice.
*/
- val minWidthForStats = smallFontDims.width * 45
+ val minWidthForStats: Int = smallFontDims.width * 45
/**
* Determine the dimensions for a single character using `font`. It is assumed that the font
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Style.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Style.scala
index 303e3c0a1..9ff7f430e 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Style.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Style.scala
@@ -43,5 +43,5 @@ case class Style(color: Color = Color.BLACK, stroke: Stroke = new BasicStroke(1.
}
object Style {
- val default = Style()
+ val default: Style = Style()
}
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Text.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Text.scala
index d104f3432..dd4f9e30e 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Text.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Text.scala
@@ -42,7 +42,7 @@ case class Text(
) extends Element
with VariableHeight {
- lazy val dims = ChartSettings.dimensions(font)
+ lazy val dims: ChartSettings.Dimensions = ChartSettings.dimensions(font)
def truncate(width: Int): Text = {
val maxChars = (width - Text.rightPadding) / dims.width
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Ticks.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Ticks.scala
index eb5da2f65..f4d403aae 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Ticks.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/Ticks.scala
@@ -37,7 +37,7 @@ object Ticks {
private val monthTimeFmt: DateTimeFormatter = DateTimeFormatter.ofPattern("MMM")
private val yearTimeFmt: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy")
- val timeBoundaries = List(
+ val timeBoundaries: List[(ChronoField, DateTimeFormatter)] = List(
ChronoField.SECOND_OF_MINUTE -> DateTimeFormatter.ofPattern(":ss"),
ChronoField.MINUTE_OF_HOUR -> DateTimeFormatter.ofPattern("HH:mm"),
ChronoField.HOUR_OF_DAY -> DateTimeFormatter.ofPattern("HH:mm")
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ValueAxis.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ValueAxis.scala
index 5240056a1..4f7b60a48 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ValueAxis.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/graphics/ValueAxis.scala
@@ -291,7 +291,7 @@ case class RightValueAxis(plotDef: PlotDef, styles: Styles, min: Double, max: Do
object ValueAxis {
- val labelHeight = ChartSettings.normalFontDims.height
+ val labelHeight: Int = ChartSettings.normalFontDims.height
/**
* Width of value tick labels. The assumption is a monospace font with 7 characters. The 7 is
@@ -300,9 +300,9 @@ object ValueAxis {
* - `[sign][3digits][decimal point][1digit][suffix]`: e.g., `-102.3K`
* - `-1.0e-5`
*/
- val tickLabelWidth = ChartSettings.smallFontDims.width * 7
+ val tickLabelWidth: Int = ChartSettings.smallFontDims.width * 7
val tickMarkLength = 4
- val minTickLabelHeight = ChartSettings.smallFontDims.height * 3
+ val minTickLabelHeight: Int = ChartSettings.smallFontDims.height * 3
}
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/TickLabelMode.java b/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/TickLabelMode.java
index 57fe60700..37a8e4b9c 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/TickLabelMode.java
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/TickLabelMode.java
@@ -28,17 +28,14 @@ public enum TickLabelMode {
OFF,
/**
- * Use decimal metric prefixes for tick labels.
- *
- * https://en.wikipedia.org/wiki/Metric_prefix
+ * Use decimal metric prefixes for
+ * tick labels.
*/
DECIMAL,
/**
- * Use binary prefixes for tick labels. Typically only used for data in bytes such as disk
- * sizes.
- *
- * https://en.wikipedia.org/wiki/Binary_prefix
+ * Use binary prefixes for tick
+ * labels. Typically only used for data in bytes such as disk sizes.
*/
BINARY,
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/VisionType.java b/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/VisionType.java
index 9e812a5b6..21299baef 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/VisionType.java
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/model/VisionType.java
@@ -19,7 +19,7 @@
/**
* Convert a color to simulate a type of color blindness for those with normal vision. Based on:
- * http://web.archive.org/web/20081014161121/http://www.colorjack.com/labs/colormatrix/
+ * colormatrix.
*/
public enum VisionType {
normal(new double[] {
diff --git a/atlas-chart/src/main/scala/com/netflix/atlas/chart/util/GraphAssertions.scala b/atlas-chart/src/main/scala/com/netflix/atlas/chart/util/GraphAssertions.scala
index f26d913ae..41f3c38c2 100644
--- a/atlas-chart/src/main/scala/com/netflix/atlas/chart/util/GraphAssertions.scala
+++ b/atlas-chart/src/main/scala/com/netflix/atlas/chart/util/GraphAssertions.scala
@@ -88,7 +88,7 @@ class GraphAssertions(goldenDir: String, targetDir: String, assert: (Any, Any) =