We have 2 different Y axes, and they share 1 X-axis. As a concrete example (this is simplified XML),
<searchTemplate> metric=$longevityOngoingMetric$ OR metric=~feedKBPS
| FILLNULL value="*" | EVAL metric_and_indexer = metric . " at " . indexer
| CHART avg(value) BY hours, metric_and_indexer </searchTemplate>
; longevityOngoingMetric is one of { avg | tcp | udp } EPS . Clearly, ~feedKBPS events should have one Y-axis, and the *EPS events should have another. We have events split between 2 charts, and those charts need to be overlaid.
Note that ~feedKBPS sorts lexicographically after any "normal" metrics, so its chart is second: chart2 . The remaining events go into first chart, chart1 .
Normally, chart1 is the only chart, and the 1 is implied; so you might see corresponding properties foo and foo2 , which really means foo1 and foo2 .
So, here is the chart element:
<chart>
<option name="charting.chart">line</option>
<option name="charting.chart.nullValueMode">connect</option>
<option name="charting.axisTitleX.text">hours from test start</option>
<option name="charting.axisTitleY.text">some kind of EPS</option>
<option name="charting.axisTitleY2">axisTitle</option>
<option name="charting.axisTitleY2.text">feed rate, KBPS</option>
<option name="charting.axisY2">#axisY</option>
<option name="charting.axisLabelsY2">#axisLabelsY</option>
<option name="charting.axisLabelsY2.axis">@axisY2</option>
<option name="charting.axisLabelsY2.placement">right</option>
<option name="charting.data1">view</option>
<option name="charting.data1.table">@data</option>
<option name="charting.data1.columns">[0,1:10]</option>
<option name="charting.data2">view</option>
<option name="charting.data2.table">@data</option>
<option name="charting.data2.columns">[0,11]</option>
<option name="charting.chart.data">@data1</option>
<option name="charting.chart2">#chart</option>
<option name="charting.chart2.axisY">@axisY2</option>
<option name="charting.chart2.data">@data2</option>
<option name="charting.layout.charts">[@chart,@chart2]</option>
<option name="charting.layout.axisLabels">[@axisLabelsX,@axisLabelsY,@axisLabelsY2]</option>
<option name="charting.layout.axisTitles">[@axisTitleX,@axisTitleY,@axisTitleY2]</option>
</chart>
A few notes on this:
it's helpful to run the query from CLI, and see the tabular output; that will make the idea of "columns" clear in this context.
we have 10 indexers, so there will be 10 columns pertaining to the 1st (left) Y-axis. That is why you see <option name="charting.data1.columns">[0,1:10]</option> ; the 1:10 specifies the first 10 columns, in starting-with-1 array segment notation. (In a Pascal-meets-Python kind of way.)
~feedKBPS is only 1 column, so that is why you see <option name="charting.data2.columns">[0,11]</option> ; the 11 specifies the 11th column.
equivalent of <option name="charting.chart.nullValueMode">connect</option> for chart2, would be <option name="charting.chart2.nullValueMode">connect</option>
if you only have 2 columns (and not 11), then there would simply be:
<option name="charting.data1.columns">[0,1]</option>
...
<option name="charting.data2.columns">[0,2]</option>
image of resulting report:
(some details differ from simplified explanation above)
... View more