← Back to team overview

graphite-dev team mailing list archive

Re: [Question #250223]: internal canvas width and rendering position consistancy

 

Question #250223 on Graphite changed:
https://answers.launchpad.net/graphite/+question/250223

    Status: Needs information => Open

bobemoe gave more information on the question:
Hi, thanks for your reply.  Are you referring to the actual image size
(which I agree always comes out at the size specified with &width=
&height=) or the internal size of the graphing area (axis) within that
image? I'm not sure that you've fully understood my issue, let me try
and explain better with the help of the URL's you've requested and also
a screenshot.

Here is a screenshot of two graphs of the same size on the same page:
http://jhodges.co.uk/graphs.png

And here are the URL's used to render them:
/render/?title=Battery & Inverter&width=1678&height=312&from=11:36_20140618&hideLegend=0&vtitle=Power (kW)&vtitleRight=Voltage (Vdc)&target=alias(secondYAxis(color(alpha(lineWidth(inverter.battery.Vdc,3),0.7),"000000")),"Battery")&target=alias(color(lineWidth(inverter.input.kW,2),"00aa00"),"Input")&target=alias(color(lineWidth(inverter.output.kW,2),"aa0000"),"Output")&target=alias(color(alpha(stacked(removeBelowValue(scale(multiplySeries(inverter.battery.{Adc,Vdc}),0.001),0)),0.5),"88ff88"),"Charge")&target=alias(color(alpha(stacked(removeBelowValue(scale(multiplySeries(inverter.battery.{Adc,Vdc}),-0.001),0)),0.5),"ff8888"),"Discharge")&target=alias(color(inverter.battery.kWh.charge,"88ff88"),"Charge (*h)")&target=alias(color(inverter.battery.kWh.discharge,"ff8888"),"Disharge (*h)")&until=02:01_20140619

/render/?title=Temperatures&width=1678&height=312&from=11:36_20140618&hideLegend=0&yAxisSide=right&yDivisors=10&target=color(alias(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.batteryRoom,1),-55),200),"Battery
Room"),"#C9C60E")&target=color(alias(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.generatorCabinet,1),-55),200),"Generator
Cabinet"),"#C90EC6")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.generatorThermStore,1),-55),200),"#880000"),"Generator
Thermal
Store")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.outside,1),-55),200),"#8899ED"),"Outside
(Ground)")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.outside2,1),-55),200),"#1199ED"),"Outside
(Air)")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.outside3,1),-55),200),"#ff99ED"),"Outside
(Surface)")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.houseThermStore,1),-55),200),"#000088"),"House
Thermal
Store")&target=alias(color(removeAboveValue(removeBelowValue(keepLastValue(ATmegaNET.powerhouse.temp.houseThermStoreTop,1),-55),200),"#0000FF"),"House
Thermal Store
(Top)")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.powerhouse.temp.houseLoft,-55),200),1),"#C97B0E"),"House
Loft")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.shed,-55),200),1),"#888888"),"Potting
Shed")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.greenhouse,-55),200),1),"#00ff00"),"Greenhouse
(air)")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.greenhouse_soil,-55),200),1),"#00cc00"),"Greenhouse
(soil)")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.greenhouse_water,-55),200),1),"#009900"),"Greenhouse
(water)")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.tank1,-55),200),1),"#004444"),"AD
Tank
1")&target=alias(color(keepLastValue(removeAboveValue(removeBelowValue(ATmegaNET.shed.temp.tank2,-55),200),1),"#444400"),"AD
Tank 2")&until=02:01_20140619

As you can see the "widht", "height", "from" and "until" parameters are
the same in both URL's, and as expected the resulting image widths and
heights and time range are identical.  The problem arises because the
first graph has 2 Y-axis and the second only has one, different labels,
values etc.  This means the internal area remaining for the actual graph
is different, and as you can see from the screenshot, points in time
(e.g. 14:00) on both graphs do not align with each other. This makes
comparing points on the top graph to the bottom graph not very
practical.

I could make sure all graphs have 2 y-axis that are both labelled but even then if the axis for one graph goes into triple figures and the other is only double figures, the area used by the axis will still vairy. Although I'm not sure that would help anyway, as even with no axis the internal graphing area still differs, check out this second screenshot of all the graphs showing together, with no axis, legend or titles etc.  All width/height/from/until are the same as before, and you can see some of the graph areas still differ.  The only things that are different are the metrics being displayed, and some of those metrics do have different aggregation rules and storage schemas,  I suspect some of the point consolidation functions choose a axis width based on a multiple of the storage schemas which is what is introducing the variation, but that's just a guess!
http://jhodges.co.uk/graphs2.png

Hope this helps clarify.
Cheers

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.