Google charts - when Y range is changed, graph doesn't scale correctly - scaling

I'm using a simple Google chart to picture a benchmark:
Since most data is located between 50 and 100 I tried to make the range a bit smaller but this results in an incorrect graph.
First value of the red line starts at 72 on first graph but at 87 on the second one. The HTML code looks like the following:
<img src="http://chart.apis.google.com/chart?chxr=0,50,100|1,0,50&chxt=y,x&chs=900x300&cht=ls&chco=DA3B15,3072F3&chd=s:stt3rp3ts7rp2ut7uz7tt5rr5rw5rs2qr2qr2tq5rr3qp3rr2q,uqq2sp0nqnzoop3qq2tt4tr2sr2rw1rq2rr2qs3pozpoo4rp2p&chdl=With+lock|Without+lock&chg=50,20&chls=2|2&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock&chts=676767,13" width="1000" height="300" alt="FluorineFx - FactoryInstance with/without lock" />
Has anyone a solution that helps scaling the graph correctly?

To make it work I had to change the input data to plain data format to:
chd=t:72,73,... // char data
Define the required range for the axis ranges:
chxr=0,60,100,10|1,0,50,5
Specify the char custom scaling value:
chds=60,100
Which results in:
<img src="https://chart.googleapis.com/chart?chs=900x300&cht=ls&chd=t:72,73,73,90,71,68,90,73,72,97,71,68,88,76,74,97,76,84,96,74,74,94,70,70,94,71,78,93,71,72,89,69,70,89,69,70,88,74,69,94,71,71,90,69,68,90,71,70,89,69|75,69,69,89,72,67,85,64,69,64,84,65,65,67,90,69,69,89,73,73,92,74,70,88,72,70,88,71,78,87,70,69,88,70,71,88,69,72,90,68,65,84,67,66,66,91,71,68,89,68&chxt=y,x&chds=60,100&chxr=0,60,100,10|1,0,50,5&chbh=35&chg=10,10&chco=DA3B15,3072F3&chdl=With+lock|Without+lock&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock"/>

Related

rectangles on Grace plots

I have been using Grace (xmgrace) plotting for many years. I recently had an important idea for my work, and it involves rectangles on my plots. Grace supports rectangles (called "boxes"), but when I use a filled "box" it blocks my data curves. I want the curves to show over the filled rectangles. This is driving me nuts. Does anyone know how to put the filled rectangles in the background so they don't block data curves? Thanks.
Unfortunately there is no option in the xmgrace graphical interface that allows you to modify the z order of drawing objects such as boxes:
I also saved the graph as an .agr file and viewed it in a text editor. There doesn't seem to be any flag within the file format to modify z position, either.
Same story if you save a parameter file and check it in a text editor.
So it looks like it is really not possible in xmgrace.
One workaround would be to print to a postscript, EPS or SVG file and open it inside a vector graphics program such as Inkscape (results vary, you might need to experiment with filetypes to see which works best). Then you can easily alter the z order of objects.

Split x axis for every value in graph, in Power BI

I have the following graph in Power BI:
and I'm trying to recreate the below graph from Excel (note the X axis with the months February and January, with the Operation Text:
As you can see, my attempt only displays the Operation Text rather than the month and Operation Text).
Here is what my current axis looks like:
Changing the axis to have Actual Start Date on top, rather than the Operation Text:
Makes my graph look like this:
Is it possible to achieve the same outcome as in Excel, with the values in my graph showing the two months side by side, for each operation text? If so, how can I do this?
I've tried looking into the X axis 'format' settings and wasn't able to see anything obvious to help achieve this. In addition, unfortunately the graph I'm looking to recreate is only a screenshot so I am unable to see how it achieves that outcome.
EDIT:
As suggested, I attempted to place Operation Text into the Legend field in my Visualisations section but I am unable to, due to the fact that I have two Value fields (the two columns Actual Hours and Estimated Hours).
#CR7SMS is correct. You just need to expand down to the next level using that split arrow in the upper right of the visual so that this:
Becomes this:
Note that to get the axis to look like this, you'll need to sort on month rather than one of the measures.
You'll also want to turn off 'Concatenate labels' toggle in the 'Format > X axis' section of the visual settings.
You would have to drill down one level, using the arrows seen at the top right of your first screenshot. For your specific purposes, the split arrow should do the trick. Hope this helps.
Have you tried moving your date or operation text column in legend section ?..not 100% but something close to your requirement you can achieve

chd=t truncate data to 100

I've read all of the documentation, and I can't seem to figure this one out. I have the following URL for an image chart, however it caps the data at 100 for some reason. I've been going crazy trying to figure out what that is.
https://image-charts.com/chart?chco=167DB3&chd=t:62,102,154,145,153,212,215,171,184,148,103,90,62,27,33,28,32,38,22,11,10,13,13,20&chm=B,0D4564,0,0,0&chma=0,0,20,10&chs=900x400&cht=lc&chxl=0:|7AM|8AM|9AM|10AM|11AM|12PM|1PM|2PM|3PM|4PM|5PM|6PM|7PM|8PM|9PM|10PM|11PM|12AM|1AM|2AM|3AM|4AM|5AM|6AM&chxt=x,y&chtt=Calls+By+Hour&chxr=1,0,200
chd=t: (coming from Google Image Charts format) limits data to 100. See the first line of our documentation here.
Basic text-formatted data lets you specify floating point values from 0—100, inclusive, as numbers. Values below zero are marked as missing; values above 100 are truncated to 100.
But the good news, we did not stop at being a drop-in-replacement for Google Image Charts....... We've improved it!
Use our Awesome Text format instead, change chd=t: to chd=a: and you are done!
with chd=t:
https://image-charts.com/chart?chco=167DB3&chd=t:62,102,154,145,153,212,215,171,184,148,103,90,62,27,33,28,32,38,22,11,10,13,13,20&chm=B,0D4564,0,0,0&chma=0,0,20,10&chs=900x400&cht=lc&chxl=0:|7AM|8AM|9AM|10AM|11AM|12PM|1PM|2PM|3PM|4PM|5PM|6PM|7PM|8PM|9PM|10PM|11PM|12AM|1AM|2AM|3AM|4AM|5AM|6AM&chxt=x,y&chtt=Calls+By+Hour&chxr=1,0,200
with chd=a:
https://image-charts.com/chart?chco=167DB3&chd=a:62,102,154,145,153,212,215,171,184,148,103,90,62,27,33,28,32,38,22,11,10,13,13,20&chm=B,0D4564,0,0,0&chma=0,0,20,10&chs=900x400&cht=lc&chxl=0:|7AM|8AM|9AM|10AM|11AM|12PM|1PM|2PM|3PM|4PM|5PM|6PM|7PM|8PM|9PM|10PM|11PM|12AM|1AM|2AM|3AM|4AM|5AM|6AM&chxt=x,y&chtt=Calls+By+Hour&chxr=1,0,200
Edit this chart

White space between data and axis when using pcolor in octave

I am trying to create a colorplot using pcolor. I want to use "shading interp" so am not using imagesc(). However when I set the axis manually the plot has white space between the data and the axis.
I want to zoom into one section of the data rather than the whole image. (This problem does not occur when the matrix and using "axis("tight") )
Thank you in advance for your help
The code I am using is :
clf
load x.dat;
load y.dat;
load 15-1-14_E2_lam_7410nm.txt
x=x;
y=y;
A=X15_1_14_E2_lam_7410nm;
A=rot90(A);
h=pcolor(x,y,A);
shading interp
set(h,"EdgeColor",'none');
axis([60 90 -20 20])
#axis("tight")
colorbar
I believe the white space at one or more axis edges is because your data does not go fully to the edge of the frame (or the axis) you are setting. This can happen frequently when using something like meshgrid() to set the frame from -L to L in steps dl but then your data may start at -L and only go to, say, L-dl.

Google Charts Image. Data graph line is not according to axis

I am using Google Chart Image to make graphical chart. I am using PHP to provide the data to the link which in return gives me desired chart. The x-axis and y-axis values are also dynamic i.e. if the graph data is 23,45,37,29... then the y-axis value will range from 20 to 50 and if it is more then that then it will scale according to the data..
Now the problem I am not able to solve is that the dynamic values work fine but I am not able to move the graph line. The image below will clear this point:
Click here for the graph image.
The data provided to this graph is = 190.12,185.53,186.22,186.71,185.87,185.57,186.50,186.58,190.71,191.41,190.12185
The data range is approx between 180 to 190 but graph drawn is between 198 and 200.
I have used chxr to scale the axis. and the link which I am dynamically updating through php is:
THIS
I believe the problem you've got is that you're scaling the axis labels, but not the axis itself. You want to change the chds parameter from a to the range you're dealing with.
This chart looks okay to me.

Resources