diff --git a/atlas-chart/src/main/resources/reference.conf b/atlas-chart/src/main/resources/reference.conf index cee07c23b..dd6f98853 100644 --- a/atlas-chart/src/main/resources/reference.conf +++ b/atlas-chart/src/main/resources/reference.conf @@ -86,7 +86,7 @@ atlas { max-height = 1000 max-zoom = 2.0 max-lines-in-legend = 50 - max-yaxes = 4 + max-yaxes = 5 } } } \ No newline at end of file diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_binary.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_binary.png index 4b125b771..c8de9c0dc 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_binary.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_binary.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_color.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_color.png index 4e14ce564..f2e7c39d4 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_color.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_color.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_duration.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_duration.png index 1de4a94c0..b42b59235 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_duration.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_duration.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_identity.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_identity.png index 696ae00af..57a9e84d1 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_identity.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_identity.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_logarithmic.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_logarithmic.png index b4a4107ae..8f42d6692 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_logarithmic.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_logarithmic.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_lower.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_lower.png index a7a6fea28..8d70bf889 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_lower.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_lower.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_power.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_power.png index 0ad675bd4..23fd57df3 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_power.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_power.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_sqrt.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_sqrt.png index 4f08dc4ea..58407ce1c 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_sqrt.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_sqrt.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_upper.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_upper.png index b58ce2e2a..e988569ad 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_upper.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_upper.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel.png index f9e00f4a7..256bf0344 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel_wrap.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel_wrap.png index afc701866..8bf07c4fe 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel_wrap.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_default_multiy_n_ylabel_wrap.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_binary.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_binary.png index 107f90cec..0f1d82c98 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_binary.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_binary.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_color.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_color.png index 5644233d6..01313481b 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_color.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_color.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_duration.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_duration.png index 4c4630922..652a2ac24 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_duration.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_duration.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_identity.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_identity.png index 711995d9f..c88300bfb 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_identity.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_identity.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_logarithmic.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_logarithmic.png index b8cb77458..caf65e728 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_logarithmic.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_logarithmic.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_lower.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_lower.png index 179aa77c1..bb7477471 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_lower.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_lower.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_power.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_power.png index 7626a7ce3..0c3d64ade 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_power.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_power.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_sqrt.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_sqrt.png index f5da51f91..30696b221 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_sqrt.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_sqrt.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_upper.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_upper.png index b00f5ef5c..4f8e789a5 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_upper.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_upper.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel.png index cde090dcb..29901aaf7 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel_wrap.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel_wrap.png index 7c17672c2..70d387128 100644 Binary files a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel_wrap.png and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/default_multiy_n_ylabel_wrap.png differ diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala index 65cb5fcb7..0709a78a0 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala @@ -116,7 +116,7 @@ case class Grapher(settings: DefaultSettings) { .getOrElse(Features.STABLE) import com.netflix.atlas.chart.GraphConstants.* - val axes = (0 to MaxYAxis).map(i => i -> newAxis(params, i)).toMap + val axes = (0 until MaxYAxis).map(i => i -> newAxis(params, i)).toMap val vision = params.get("vision").map(v => VisionType.valueOf(v)) @@ -311,7 +311,7 @@ case class Grapher(settings: DefaultSettings) { val plots = plotExprs.toList.sortWith(_._1 < _._1).map { case (yaxis, exprs) => - val axisCfg = config.flags.axes(yaxis) + val axisCfg = config.flags.getAxis(yaxis) val dfltStyle = if (axisCfg.stack) LineStyle.STACK else LineStyle.LINE val statFormatter = axisCfg.tickLabelMode match { diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/ImageFlags.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/ImageFlags.scala index a50630540..6a04690fb 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/ImageFlags.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/ImageFlags.scala @@ -45,4 +45,11 @@ case class ImageFlags( case None => settings.primaryPalette(theme) } } + + def getAxis(index: Int): Axis = { + axes.get(index) match { + case Some(axis) => axis + case None => throw new IllegalArgumentException(s"invalid axis: $index") + } + } } diff --git a/atlas-eval/src/test/resources/graph/GrapherSuite/8be34e28.png b/atlas-eval/src/test/resources/graph/GrapherSuite/8be34e28.png new file mode 100644 index 000000000..116c9b604 Binary files /dev/null and b/atlas-eval/src/test/resources/graph/GrapherSuite/8be34e28.png differ diff --git a/atlas-eval/src/test/resources/graph/GrapherSuite/c367847b.png b/atlas-eval/src/test/resources/graph/GrapherSuite/c367847b.png new file mode 100644 index 000000000..27317ab56 Binary files /dev/null and b/atlas-eval/src/test/resources/graph/GrapherSuite/c367847b.png differ diff --git a/atlas-eval/src/test/resources/graph/GrapherSuite/fd24ee41.png b/atlas-eval/src/test/resources/graph/GrapherSuite/fd24ee41.png new file mode 100644 index 000000000..27317ab56 Binary files /dev/null and b/atlas-eval/src/test/resources/graph/GrapherSuite/fd24ee41.png differ diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala index b9e90e708..d9af9acd6 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala @@ -290,6 +290,25 @@ class GrapherSuite extends FunSuite { "&ylabel.0=Axis%200&ylabel.1=Axis%201" } + imageTest("multi-Y, 5 axes") { + "/api/v1/graph?e=2012-01-01T00:00&q=(,0,1,2,3,4,),(,:dup,:axis,),:each" + } + + test("multi-Y, 6 axes") { + val uri = "/api/v1/graph?e=2012-01-01T00:00&q=(,0,1,2,3,4,6,),(,:dup,:axis,),:each" + intercept[IllegalArgumentException] { + grapher.evalAndRender(Uri(uri), db) + } + } + + imageTest("multi-Y, 5 axis per line") { + "/api/v1/graph?e=2012-01-01T00:00&q=0,1,2,3,4&axis_per_line=1" + } + + imageTest("multi-Y, 6 axis per line") { + "/api/v1/graph?e=2012-01-01T00:00&q=0,1,2,3,4,6&axis_per_line=1" + } + imageTest("significant time boundaries and tz=US/Pacific") { "/api/v1/graph?q=name,sps,:eq,:sum&s=e-2d&e=2015-06-17T13:13&no_legend=1&tz=US/Pacific" } diff --git a/atlas-webapi/src/test/resources/GraphApiSuite/42bb9a56.png b/atlas-webapi/src/test/resources/GraphApiSuite/42bb9a56.png index c2d26a972..b4162eca7 100644 Binary files a/atlas-webapi/src/test/resources/GraphApiSuite/42bb9a56.png and b/atlas-webapi/src/test/resources/GraphApiSuite/42bb9a56.png differ diff --git a/atlas-webapi/src/test/resources/GraphApiSuite/7a906f27.png b/atlas-webapi/src/test/resources/GraphApiSuite/7a906f27.png index c306df2a5..ddb188ac7 100644 Binary files a/atlas-webapi/src/test/resources/GraphApiSuite/7a906f27.png and b/atlas-webapi/src/test/resources/GraphApiSuite/7a906f27.png differ