image-charts url is not respecting chds - image-charts

chds = 0,1800
https://image-charts.com/chart?chd=a%3A2060%2C971%2C849&chds=0,1800&chs=700x100&cht=bvg
chds = 0,2000
https://image-charts.com/chart?chd=a%3A2060%2C971%2C849&chds=0,2000&chs=700x100&cht=bvg
So chds = 0,1800 has a lower bar than chds = 0,2000 when I expect the opposite. With chds = 0,1800 I expect the bar to take up the whole image since 2060 is more than 1800.
Docs: https://documentation.image-charts.com/reference/chart-axis/

Image-Charts founder here :)
As per our documentation, chds as you want to use it works with chd=t: (like in Google Image Charts). chds is not necessary with chd=a:.
With chd=t: chds work as expected:
chds=0,1800&chd=t:
https://image-charts.com/chart?chd=t:2060,971,849&chds=0,1800&chs=700x100&cht=bvg
chds=0,2000&chd=t:
https://image-charts.com/chart?chd=t:2060,971,849&chds=0,2000&chs=700x100&cht=bvg

Related

Coldfusion: CFChart format labels on horizontal bar graph

I am having trouble aligning Horizontal Bar graph x-axis Labels, I have long names that I have wrapped using /n. The labels are no longer right aligned (see picture). Is there a way to left or right align (see image)?
I am new creating charts in CF and am stumbling around, if anyone can point me to any documentation that will allow me to know what are valid attributes are for elemets (ie: xAxis...itemsOverlap), I stumbled on this from a post but don't know where to find this info, thanks.
While I am here is there any way to change the color of the value displayed for each bar? (or have that number appear inside the bar?).
again thank for your patients as I am new to this.
<CFSET xAxis_disp = {"itemsOverlap":true, "max-items": SQL_Query.RecordCount}>
<CFSET aspect3d_small={"angle":0,"depth":7,"true3d":false}>`
<CFSET yAxisStep_25 = {"min-value":"0","step":"5"}>
<CFCHART
style="default"
show3d="yes"
chartHeight="#chartHeight_error#"
chartwidth="500"
type="horizontalbar"
gridlines="20"
yAxis = "#yAxisStep_25#"
xAxis="#xAxis_disp#"
aspect3d="#aspect3d_small#"
font="times" >
<CFCHARTSERIES
colorlist="##234086,##284A99,##284A99,##325CC0,##3D68CD,##5077D2,##6486D7,##7795DC,##8BA4E1"
query="SQL_Query"
type="bar"
datalabelstyle="value"
itemcolumn="CRFNAME"
valuecolumn="ErrCounter">
</CFCHARTSERIES>
</CFCHART>
Chart Labels, not aligned
FWIW, CFChart is just a wrapper around ZingChart, so the ZingCharts docs will be more helpful for stuff like this. I usually end up googling "How to do [X] with ZingChart" and/or pore over the ZingChart docs to find the syntax ... then figure out how it maps to the CF attributes with a little trial and error :-).
Anyway, the xAxis item alignment is controlled with "item": { "text-align":"right"}. Add it to your xAxis_disp structure. For the other xAxis attributes (i.e. "Scale-X"), have a look at the ZingChart docs
<CFSET xAxis_disp = {"items-overlap":true
, "max-items": 6
, "auto-fit": true
, "item": { "text-align":"right"}
}>
Runnable TryCF.com Example

Only half of the graph is shown when rendering from image-charts URL

When using image-charts with the URL below - only half the graph is being drawn. This used to work a few days ago just fine - did something recently change?
Missed this important information from the documentation https://documentation.image-charts.com/reference/chart-axis/#custom-axis-labels
Note: Do not place a pipe after the final label in the chxl parameter
In the half graph version, I had one trailing pipe in the chxl parameter:
https://image-charts.com/chart?cht=lc
&chd=t:17.7,17.7,17.6,17.5,17.4,17.3,17.3,17.2,17.1,17.3,17.6,17.4,17.2,17.1,16.9,16.8,16.8,16.7,16.6,16.5,16.4,16.4,16.3,16.3,16.2,16.2,16.1,16.1,16,16,16,16,16,15.9,15.9,15.9,15.9,15.9,15.9,15.9,15.8,15.8,15.8,16.7,16.9,16.6,16.5,16.4,16.2,16.1,16.1,16.1,16,16,16,16,16.6,16.7,16.6,16.5,16.4,16.4,16.4,16.4,16.4,16.6,17.3,17.3,17.2,17.1,17,16.8,16.8,16.7,17,16.9,16.8,16.7,16.6,16.5,16.4,16.3,16.2,16.2,16.3,16.3,16.2,16.2,16.3,16.3,16.3,16.2,16.4,16.3,16.5,16.7|66.6,64.8,62,60.9,60.5,60.7,60.6,60.4,60.4,62.9,61,60.2,60.1,60.2,60.2,60.1,60.1,60.2,60.3,60.3,60.3,60.3,60.5,60.6,60.5,60.6,60.9,60.9,60.9,61.2,61.5,61.6,61.8,62.2,62.4,62.5,62.7,62.7,62.8,62.6,63.2,63,63.1,62.3,62.4,63.9,63.8,63.2,61.8,62.9,64.8,61.5,60.1,58.3,59.7,59.8,62,62.5,59.8,58,56.9,56.3,56.3,56,55.6,59.8,63.1,56.1,53.9,52.7,52,51.4,51.8,52.4,53.2,53.1,53.4,53.8,54.3,54.6,54.9,55.2,55.5,61.7,61.6,59.2,58.8,59.4,61.8,60.2,59.8,59.3,66.7,64.2,74.4,76.3
&chds=a
&chof=.png
&chs=999x800
&chdl=Temperature|Humidity
&chg=20,4
&chco=2196F3,FF5722
&chtt=Temperature Humidity Chart
&chxt=x,y
&chxl=0:|21:15||||22:15||||23:15||||00:15||||01:15||||02:15||||03:15||||04:15||||05:15||||06:15||||07:15||||08:15||||09:15||||10:15||||11:15||||12:15||||13:15||||14:15||||15:15||||16:15||||17:15||||18:15||||19:15||||20:15|
&chls=3|3
&chdlp=b
&chf=bg,s,FFFFFF
Changing this so there is no trailing pipe in the chxl parameter fixed the issue:
https://image-charts.com/chart?cht=lc
&chd=t:17.7,17.7,17.6,17.5,17.4,17.3,17.3,17.2,17.1,17.3,17.6,17.4,17.2,17.1,16.9,16.8,16.8,16.7,16.6,16.5,16.4,16.4,16.3,16.3,16.2,16.2,16.1,16.1,16,16,16,16,16,15.9,15.9,15.9,15.9,15.9,15.9,15.9,15.8,15.8,15.8,16.7,16.9,16.6,16.5,16.4,16.2,16.1,16.1,16.1,16,16,16,16,16.6,16.7,16.6,16.5,16.4,16.4,16.4,16.4,16.4,16.6,17.3,17.3,17.2,17.1,17,16.8,16.8,16.7,17,16.9,16.8,16.7,16.6,16.5,16.4,16.3,16.2,16.2,16.3,16.3,16.2,16.2,16.3,16.3,16.3,16.2,16.4,16.3,16.5,16.7|66.6,64.8,62,60.9,60.5,60.7,60.6,60.4,60.4,62.9,61,60.2,60.1,60.2,60.2,60.1,60.1,60.2,60.3,60.3,60.3,60.3,60.5,60.6,60.5,60.6,60.9,60.9,60.9,61.2,61.5,61.6,61.8,62.2,62.4,62.5,62.7,62.7,62.8,62.6,63.2,63,63.1,62.3,62.4,63.9,63.8,63.2,61.8,62.9,64.8,61.5,60.1,58.3,59.7,59.8,62,62.5,59.8,58,56.9,56.3,56.3,56,55.6,59.8,63.1,56.1,53.9,52.7,52,51.4,51.8,52.4,53.2,53.1,53.4,53.8,54.3,54.6,54.9,55.2,55.5,61.7,61.6,59.2,58.8,59.4,61.8,60.2,59.8,59.3,66.7,64.2,74.4,76.3
&chds=a
&chof=.png
&chs=999x800
&chdl=Temperature|Humidity
&chg=20,4
&chco=2196F3,FF5722
&chtt=Temperature Humidity Chart
&chxt=x,y
&chxl=0:|21:15||||22:15||||23:15||||00:15||||01:15||||02:15||||03:15||||04:15||||05:15||||06:15||||07:15||||08:15||||09:15||||10:15||||11:15||||12:15||||13:15||||14:15||||15:15||||16:15||||17:15||||18:15||||19:15||||20:15||||21:15
&chls=3|3
&chdlp=b
&chf=bg,s,FFFFFF
Great that I have managed to fix it moving forward 😀 but not great for all the hundreds of half charts 😔

How to draw to the full window in rgl?

I am drawing 4 subfigures in rgl to a window, and I would like them to fill the available space:
library(rgl);
rgl::open3d(windowRect = c(0,50, 1200, 1200));
rgl::mfrow3d(2, 2);
rgl::next3d(reuse=FALSE);
rgl::bg3d("yellow");
rgl::next3d(reuse=FALSE);
rgl::bg3d("blue");
rgl::next3d(reuse=FALSE);
rgl::bg3d("red");
rgl::next3d(reuse=FALSE);
rgl::bg3d("green");
However, the result uses only a tiny potion of the window, it looks like this:
How can I make the 4 colored areas span the whole window, instead of only using the tiny part in the lower left corner?
It tools me hours, but I have finally managed to get this to work reliably by myself. It seems you have to call par3d() after open3d().
Also note the call to Sys.sleep, as suggested by user20650 in the comments above. Without it, the window only gets drawn in full size after clicking on it (on my machine?).
Full working code:
rgloptions = list("windowRect"=c(50,50,1000,1000));
rgl::open3d();
do.call(rgl::par3d, rgloptions);
Sys.sleep(1);
rgl::mfrow3d(2, 2);
rgl::next3d(reuse=FALSE);
rgl::bg3d("yellow");
rgl::next3d(reuse=FALSE);
rgl::bg3d("blue");
rgl::next3d(reuse=FALSE);
rgl::bg3d("red");
rgl::next3d(reuse=FALSE);
rgl::bg3d("green");
This gives the following output reliably:
I'm not sure if this is an exact solution that you're looking for, but running your code as a function has worked for me.
make_box <- function(){library(rgl)
rgl::open3d(windowRect = c(0,50, 1200, 1200))
rgl::mfrow3d(2, 2)
rgl::next3d(reuse=FALSE)
rgl::bg3d("yellow")
rgl::next3d(reuse=FALSE)
rgl::bg3d("blue")
rgl::next3d(reuse=FALSE)
rgl::bg3d("red")
rgl::next3d(reuse=FALSE)
rgl::bg3d("green")}
make_box()

GE plugin tethered placemark

I am trying to code a tethered placemark in the plugin just like the ones in google earth but I can't find any reference to a single line going from ground up to the pushpin.
Here is what I have so far: what am I missing?
var placemark = ge.createPlacemark("");
var point = ge.createPoint("");
point.setLatitude(41.0);
point.setLongitude(-88.0);
placemark.setGeometry(point);
point.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_GROUND);
point.setAltitude(500);
ge.getFeatures().appendChild(placemark);
Any help would be highly appreciated Thanks in advance.
You just need to set the extrude property of the KML point to true. i.e.
point.setExtrude(true);
This specifies whether to connect the geometry to the ground with a "tail" as you require.
It is also worth noting that for extrude to have any effect the altitudeMode of the point must be either relativeToGround, relativeToSeaFloor, or absolute.
Also, you can set the properties of the point using the shorthand set method. i.e.
// latitude, longitude, altitude, altitudeMode, extrude, tessellate
point.set(41, -88, 500, ge.ALTITUDE_RELATIVE_TO_GROUND, true, false);

Can't target multiple iframes by width in Watir

require 'watir'
#browser = Watir::Browser.new #:phantomjs (same for firefox)
#browser.window.maximize
#browser.goto 'http://www.romnation.net/'
a = #browser.iframes(width: '160')
puts a[0].width
Which returns 728. Even though I explicitly stated that I only want iframes of width 160.
a = #browser.iframe(width: '160')
puts a.width
This returns 160, as expected.
Why is that, how do I target multiple iframes of certain width? (except for checking every iframe for its width)
This looks like a bug in IFrameCollection#to_a
IFrameCollection#elements is collecting the proper subset of iframes, but using the index number of the subset on the overall list of iframes it finds on the page. I'll spend some time on it this weekend. When I make a pull request I'll link it here.
In the meantime, this "works" but isn't ideal because it gives you an Element and not an IFrame:
iframes = browser.elements(css: "iframe[width='160']")
iframes.first.attribute_value('width') => 160

Resources