setup ColumnChart from WinRTXamlToolkit - xaml

I'm trying to setup Column Chart from WinRTXamlToolkit.
Let me ask:
Is there any guide for charts from this lib? Or which way you found the easiest to learn using charts?
How can I put labels near axises? In points like on below image:
P0: Times
P1: States
How to move labels above chart (like on below image)?
Thank you in advance!

I found "workarounds" (far away from perfection but works).
Below WinRTXamlToolkit = WXT
Fastest way (if you don't know WXT) is:
hide WXT elements
title (just dont set it)
legend (see Hide legend of WPF Toolkit chart with more than one data series)
create your own equivalent of above elements using native XAML (TextBlocks ..) and place it wherever you like
To get column colors for legend do
MethodInXamlBackingObject() {
var paletteOfFirstColumn = ColumnChart.Palette[0];
var columnFirstBrush = paletteOfFirstColumn["Background"];
}
BTW. tips where from to learn WXT:
analyse sources of samples in WXT - these are very detailed
analyse WXT behaviour with tool "WXT Debug Console" (included in demo app) - very powerfull
read arts about WXT and WPF Toolkit (from which WXT is a fork)

Related

ESRI ArcGIS 100.9 .NET Wpf Point icon with Line Icon

Using ArcGIS Esri 100.9 with .NET Wpf, I am trying to combine a point icon and a line geometry, but I am not sure how to do that. I want to have a line with the point symbol at the start point and only the start point. Is there any way to do that without creating separate graphics? I am using either a PictureMarkerSymbol or a MultilayerPointSymbol for the point icon, and a PolyLine for the line's geometry. Is there any way I can combine the two for a graphic? I tried using a CompositeSymbol with PictureMarkerSymbol and SimpleLineSymbol, but that created a line with the point symbol at each vertex.
PictureMarkerSymbol pointSym = GenerateSymbol(iconInfo); // custom generation function
Geometry geo = new PolyLine(iconInfo.Points);
Symbol sym = // generate the appropriate symbol for the graphic
Graphic g = new Graphic(geo, sym);
While the runtime is able to render symbols like that, at this point there's not an API for creating them programmatically (it's on the roadmap to add though). However if you use ArcGIS Pro, it can be used to author this type of symbology and then be consumed by Runtime by exporting the symbol styles and using it in your runtime application.

Kinect game in Unity: How to do background removal

I've been trying to make a Unity game that uses the Xbox One Kinect (V2).
I followed the instructions in this tutorial:
http://www.imaginativeuniversal.com/blog/2015/03/27/unity-5-and-kinect-2-integration/
There are two sample scenes in this zip file: (1) KinectView and (2) GreenScreen.
When I run the first sample (KinectView), the image looks warped, like the right part of the screenshot below:
When I run the second sample (the GreenScreen scene) I get a Null frame error:
Now I'm not really concerned the warping issue in the first scene (KinectView). I am concerned with the Background Removal feature in the second scene (GreenScreen). All I need is to see myself clipped against a custom background.
Can anyone help me figure out how to fix this NULL MSFR Frame issue?
I have uploaded the zipped project in case anyone is interested:
https://www.sendspace.com/file/j2ftqz
Thank you very much.
Update:
I have been messing with some of the Shader options in the Inspector, and noticed that all shader options work except the DX11\GreenScreenShader one. Some of them look like a normal video capture; others are better lit (additive/multiply/alpha blend/etc...).
Why is it that the DX\GreenScreenShader option is the only one that does not work, and instead show nothing more than a pink square.
Screenshot below.
Open the shader in question on your favorite text editor and change these two lines:
1) Line 15. from Texture2D _MainTex; to UNITY_DECLARE_TEX2D(_MainTex);
2) Line 59. from o = _MainTex.Sample(SampleType, i.tex); to o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );
Updating the shaders as shown above will solve the issue you describe.
Secondary Reference/Source: https://forum.unity.com/threads/kinect-v2-0-sdk-green-screen-demo-for-unity-3d-not-working-why.467687/

Rebol runtime window control create and update

In the video : REBOL VID demonstration - Nenad Rakocevic demonstrates what seems the basic code to compose a Rebol IDE at runtime.
Can someone provide a working Rebol example on how to create, update / modify faces (widget / control) within a View (window) at runtime.
So far the examples I found allow creating faces into a new window rather than update an existing one.
Thanks
The secret is to use "show" after changing what you want to change. And experiment a lot. There are nice scripts on rebol.org that use VID.
If you meant the interactive nature of the demo, that is (23.34) only 30 lines of 'cod'. I have tried to find that 'cod' but could not find it.
Good luck!
Arnold
Terse example on how to update a face :
rebol[]
view layout [
bx: box teal
btn "ShowTime" [
bx/text: now/time
bx/color: random white
show bx
]
]

Find out Easing Functions for WinRT Theme Animations

A slightly odd question, but is there anyway to find out what easing functions are used in the WinRT XAML Theme Animations - more specifically I'm trying to replicate that of the EntranceThemeTransition (which I can't use directly).
I naively thought using something like .NET reflector would help, but I'd gather I'd need the actual source code rather than what .Net Reflector shows.
Anyone any ideas?
You might like to take a look at the AnimationMetrics sample on MSDN.
There is an AnimationDescription class that will tell you all sorts of info on the built in animation types, basically anything in the Windows.UI.Core.AnimationMetrics.AnimationEffect enum.
For example:
var animationDescription = new AnimationDescription(AnimationEffect.EnterPage, AnimationEffectTarget.Incoming);
var s = new System.Text.StringBuilder();
s.AppendFormat("Stagger delay = {0}ms", animationDescription.StaggerDelay.TotalMilliseconds);
s.AppendLine();
s.AppendFormat("Stagger delay factor = {0}", animationDescription.StaggerDelayFactor);
s.AppendLine();
s.AppendFormat("Delay limit = {0}ms", animationDescription.DelayLimit.TotalMilliseconds);
s.AppendLine();
s.AppendFormat("ZOrder = {0}", animationDescription.ZOrder);
s.AppendLine();
s.AppendLine();
//etc
Link: http://code.msdn.microsoft.com/windowsapps/Animation-metrics-sample-acb0220c
I believe these built in animations are implemented in a different way and they run independently from regular Storyboard + child animations, so you would need to approximate these with some tests that compare these with regular Storyboard animations that you implement running side by side.
One way to visualize easing functions is to run a theme transition moving a UI element in one axis while you run another one that moves the element in a perpendicular axis in a linear motion (with no easing function applied).

Getting Matplotlib's GTK Agg backend to respect user theming

I'm writing a PyGTK/Twisted app that uses Matplotlib for graphing. It's easy enough to embed the plots in my widgets using the FigureCanvasGtkAgg, but I notice that the background colour of the canvas (outside the plot area itself) does not match that for the rest of my application, and neither does the font (for labels, legends, etc).
Is there a simple way to get my graphs to respect the user selected GTK theme?
You can set it by, for example pylab.figure(facecolor=SOME_COLOR, ...) or matplotlib.rcParams['figure.facecolor'] = SOME_COLOR. It looks like that its default value is hard-coded, so there is no way to tell MPL to respect GTK theme.
Here's a concrete example of how to do this in PyGTK. Some of this information here was gleaned from "Get colors of current gtk style" and from the gdk.Color docs. I haven't gotten as far as setting the font, etc, but this shows the basic framework you need.
First, define the following function:
def set_graph_appearance(container, figure):
"""
Given a GTK container and a Matplotlib "figure" object, this will set the
figure background colour to be the same as the normal colour of the
container.
"""
# "bg" is the background "style helper" object. It contains five different
# colours, for the five different widget states.
bg_style = container.get_style().bg[gtk.STATE_NORMAL]
gtk_color = (bg_style.red_float, bg_style.green_float, bg_style.blue_float)
figure.set_facecolor(gtk_color)
You can then connect to the realize signal (maybe also the map-event signal, I didn't try) and re-colour the graph when the containing widget is created:
graph_panel.connect('realize', set_graph_appearance, graph.figure)
(Here, graph_panel is a gtk.Alignment and graph is a subclass of FigureCanvasGTKAgg that has a figure member as needed.)