glPolygonOffset equivalent in Javafx - javafx

I'm trying to plot two MeshView at exact same location, one rendered with FILL and the other with LINE in order to give it wireframe looks. But unfortunately the wireframe only appears on the backside of the mesh as shown below.
In Java3D I fixed this problem using glPolygonOffset. Is there an equivalent to that in javafx?

Related

Set width and height of graphic made using ggplot, grid, and gridExtra

If I have a graphic composed of several plots, say three plots arranged vertically. This is a gtable object and can be drawn to the page with:
grid::grid.newpage()
grid::grid.draw(plot)
However I see that the plot in my RStudio is 'smushed up' as in the screenshot below:
As you can see in the bottom right corner it is squashed and the titles overlap with other elements of the graphic.
If I hit zoom and view the plot it is a lot bigger:
Now I know, that if I were to export my gtable plot using pdf() or png() and such devices, I can set a width and a height, and so just make it big enough such that the plot is not squashed.
However, instead of one of those graphic devices, I would like to use export.grid, from the gridSVG package to save it to an SVG file. But if I do
gridSVG::export.grid(plot)
Then the SVG file exported looks squashed as it does in the RStudio plot window.
So my question is, how can I manipulate the dimensions of the graphic so it is drawn to SVG without it looking squashed? I draw the plot initially with grid.newpage and grid.draw, I wonder perhaps I have to specify some size of the page or drawing using grid.
Thanks,
Ben.

Omit footer and centralise Motion Chart created with googleVis R package

It's a general question, not one related to any specific chart; hence I'm not adding any code.
It seems there isn't a "footer" option you can use to control how the motion chart appears, in a similar vein as there are options to control for width, colours, omit the right-hand menus, etc.
Also, how can I present the chart centralised on the page rather than starting from the top left-hand corner?
Regards,
José
Trend Compass is a new concept in viewing statistics and trends in an animated way by displaying in one chart 5 axis (X, Y, Time, Bubble size & Bubble color) instead of just the traditional X and Y axis. It could be used in analysis, research, presentation etc.
Link on UK Master Card vs Visa performance:
http://www.epicsyst.com/test/v2/mastercard_vs_visa/
Link showing Drilling feature (Parent/Child) - Just double-click on any bubble:
http://www.epicsyst.com/test/v2/drilling/

Drawing on Flex Chart

I've created a line chart in flex and it works like expected. Now, I would like to add shading to the background for specific information. For example, this chart - http://research.stlouisfed.org/fred2/graph/?id=TOTALSL,TOTALNS, - shows a shaded background for recessions. How would I mimic this shading in a Flex linechart?
Thanks
You could draw it in the background of the chart using the drawing api.
edit:
I dont know of any code examples on the web, I've only done it in production code (aka I cant share it, sorry :( )
you will want to create a container and put it into the charts
<mx:backgroundElements>
You should pass into this container the min and max for the x-axis probably as separate properties and a dataprovider that describes when to show a highlighted section. You might have to compute the min and max based on the dataprovider you pass into the chart.
If you just want to show the highlighted area you will just use the drawing api and compute where to put on the x-axis based on your min, max, width of container, and data point (start and end values) from your dataprovider. It will look something like this in your updateDisplayList:
// code is not tested but a good start
var shadeStartX:Number = (max-min)/startPoint;
var shadeEndX:Number = (max-min)/endPoint;
var shadeWidth:Number = shadeEndX - shadeStartX;
...
this.graphics.drawRect(shadeStartX, 0, shadeWidth, unscaledHeight);
but if you want to have things like hover states and all that goodness I would suggest creating a display object that you pass the width in and adding that to the container at the computed x-axis to set it at.
Hi I feel that drawing something yourself is not the right way to go.
You should ideally use a PlotSeries inside the LineChart, and create a custom item renderer for each element in the series.
PlotSeries allows you to give your own custom image/object to draw at a specific date/point in the chart.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/charts/series/PlotSeries.html
http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_10.html
All the examples show the plotSeries with smaller objects but you can create an object which covers the chart vertically and has a constant width.

Flex charting - Fixing the background grid and multi-line plotting

I have two requirements for a flex charting component:
The grid lines should always remain fixed to a scaling I define using an array of data. Something like a graph paper sheet.
Plot multiple line series data over this grid.
How does one get complete control over the background grid lines? I have tried a combination of annotation elements and setting the linechart background elements. If I get the grid right, I can't plot over it (Probably due to the scale). Can anyone share how would one go about designing a graphpaper like interface for linecharts in flex/actionscript?

Flex - Placement of Legend for a chart

I would like to be able to specify the placement of a legend for a linechart. Currently, it continues to appear to the right of the chart. I have tried playing with the width/height of the chart to no avail... Putting the legend before the linechart in the mxml causes it to appear to the left. I can't seem to get it appear at the bottom though. I can't seem to find any good examples for this. They don't seem to specify anything but the legend usually shows up below the chart, I can't seem to do it. Optionally, it would be okay to somehow minimize the legend..
what container are your line chart and legend in? its sounds like you are using either an HBox or an application with the layout="horizontal". To move the legend below use either a VBox or application layout of vertical. Or you can use a canvas and use constraints (left, right, top, bottom) or x and y coordinates

Resources