Data point on Y-Axis - xaml

I am using WinRTXamlToolkit and creating a LineChart. By default the chart does not allow data points ON the axes. But I want to populate the starting data point/coordinate on the y-axis e.g. (0, 20).
How can this be done? I have yet to discover a way. Any suggestion will be helpful.

Answer is posted in the comment above by Filip who made the library.

Related

Unreal Datasmith Export - How to set Pivotpoint of Datasmith Mesh?

i'm currently developing a Datasmith export feature for an AutoCAD plugin. I'm almost done but I can't figure out how to set the pivot point of a mesh.
I've sticked to the SDK Guidelines here:
https://docs.unrealengine.com/5.0/en-US/datasmith-export-sdk-guidelines/
At some point it says
Mesh pivots must be calculated in the mesh so they don't all end up at 0, 0, 0.
Which is something I whould like to do but I can't find a way in the SDK to set the pivot...
I've expected a function like SetPivotPoint(x,y,z) or something like that on one of these types:
FDatasmithMesh
IDatasmithMeshElement
IDatasmithMeshActorElement
... But nothing :(
Any help please?
I've just understood what is meant by "the pivot point must be baked into the mesh". I've took all the points of the AutoCAD geometries and created meshes out of them as they are. But the mesh itself must be builded around the point where I want the pivot point to be (relative to the mesh).
So I think the correct way to do this is to translate all the points of the ACAD geometry so that the center point (where I want the pivot to be) is 0,0,0.
Then I build the mesh around it and translate the mesh actor, that holds the instance of the mesh, to the position in the scene where the mesh should be.
Edit: That was exactly the solution...just in case anyone else has the same problem.

.mesh file "ref" var explanation

I am trying to understand the .mesh files, usually generated for mesh visualization with Medit.
The documentation is here, but it is in french.
The thing I understand is that after every line describing and object in the file (vertex, triangle, tetrahedra, etc.) it comes a ref variable, that in the examples files I have, they usually are 0,1,2,3 and I don't understand what is their purpose.
Can somebody please explain this?
You can get an .mesh example here.
Each reference corresponds to a color in Medit. The colors are arbitrary, and can be changed in Medit (using the GUI or changing a configuration file).
The reference values in the Mesh file refers to a color index. Maybe the program uses this to display the vertices, triangles and tetrahedra with certain colors. You can ignore this value for all practical purposes.

legend on each point with pylab.plot

I would like to have each exact value as a legend above each point representing that value on my graph. Any idea of how I can do it? Thanks
enter code here
Use the annotate method of matplotlib. If you provide some example code, I'll show you how you could use it. Otherwise, the documentation and the examples of matplotlib are quite nice.

UILables, Text Flow and Layouts

Consider the following, I have paragraph data being sent to a view which needs to be placed over a background image, which has at the top and the bottom, fixed elements (fig1)
Fig1.
My thought was to split this into 4 labels (Fig1.example2) my question here is how I can get the text to flow through labels 1 - 4 given that label 1,2 & 3 ar of fixed height. I assumed here that label 3 should be populated prior to 4 hence the layout in the attached diagram.
Can someone suggest the best way of doing this with maybe an example?
Thanks
Wish I could help more, but I think I can at least point you in the right direction.
First, your idea seems very possible, but would involve lots of calculations of text size that would be ugly and might not produce ideal results. The way I see it working is a binary search of testing portions of your string with sizeWithFont: until you can get the best guess for what the label will fit into that size and still look "right". Then you have to actually break up the string and track it in pieces... just seems wrong.
In iOS 6 (unfortunately doesn't apply to you right now but I'll post it as a potential benefit to others), you could probably use one UILabel and an NSAttributed string. There would be a couple of options to go with here, (I haven't done it so I'm not sure which would be the best) but it seems that if you could format the page with html, you can initialize the attributed string that way.
From the docs:
You can create an attributed string from HTML data using the initialization methods initWithHTML:documentAttributes: and initWithHTML:baseURL:documentAttributes:. The methods return text attributes defined by the HTML as the attributes of the string. They return document-level attributes defined by the HTML, such as paper and margin sizes, by reference to an NSDictionary object, as described in “RTF Files and Attributed Strings.” The methods translate HTML as well as possible into structures of the Cocoa text system, but the Application Kit does not provide complete, true rendering of arbitrary HTML.
An alternative here would be to just use the available attributes, setting line indents and such according to the image size. I haven't worked with attributed strings at this level, so I the best reference would be the developer videos and the programming guide for NSAttributedString. https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/AttributedStrings/AttributedStrings.html#//apple_ref/doc/uid/10000036-BBCCGDBG
For lesser versions of iOS, you'd probably be better off becoming familiar with CoreText. In the end you'll be rewarded with a better looking result, reusability/flexibility, the list goes on. For that, I would start with the CoreText programming guide: https://developer.apple.com/library/mac/#documentation/StringsTextFonts/Conceptual/CoreText_Programming/Introduction/Introduction.html
Maybe someone else can provide some sample code, but I think just looking through the docs will give you less of a headache than trying to calculate 4 labels like that.
EDIT:
I changed the link for CoreText
You have to go with CoreText: create your AttributedString and a CTFramesetter with it.
Then you can get a CTFrame for each of your textboxes and draw it in your graphics context.
https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CTFramesetterRef/Reference/reference.html#//apple_ref/doc/uid/TP40005105
You can also use a UIWebView

Draw a Route between starting point to end point in google mapview

I am developing a Demo project in Xcode to draw a route between two places.
For example, from a particular starting place to end place according to latitude and longitude. However, I could not understand how to do it? With the help of google api or from any other process?
To draw a line between the starting point and ending point the best place to start is the Apple Source Code Here, it does everything and more: http://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010048-Intro-DontLinkElementID_2
You need to make a request to http://maps.google.com/maps?dirflg=w&output=dragdir&saddr=lat,lng&daddr=lat,lng ( more information on parameters can be found here: http://mapki.com/wiki/Google_Map_Parameters#Directions )
It will return points in encoded format, decode them using code from http://fkn1337.com/decode-google-maps-polylines-objective-c/
Construct MKPolyline object from this points and add it to the map.
If you want to draw route between two points in map view it is better to use Regexkitlite framework classes which will describe clearly how to achieve this.For reference and sample code go through this link.
http://sugartin.info/2011/10/12/drawing-route-on-google-map-mkmapview