watchos gauge complication like activity - watchkit

The CLKGaugeProvider has a fillFraction that can only be set between 0 and 1.
On the activity complication if I move more than my goals the gauge shows more than 100%.
How can I achieve the same result in a gauge or ring complication?

Apple supplies no complication provider class which can do this on its own.
You’ll need to implement your own custom drawing code, as part of a CLKImageProvider or CLKFullColorImageProvider, to make this work.

Related

setDataCleaningThreshold for Area Range Series

I saw in version 3.00 there is something called setDataCleaningThreshold , Can you tell its benefits , I think it's for faster loading of progressive charts.
const dcThreshold = xVal - 100;
lineSeries.setDataCleaningThreshold(dcThreshold);
AreaRangeSeries.setDataCleaningThreshold(dcThreshold); // not working
But it's not working for Area range series.
Also there is setMaxPointCount in Area range Series , what is the difference between both ?
My charts are progressive and I want to clear the charts that are out of view and make the charts faster.What is the best way ? Can I use Dispose method ?
Also , can we drag the chart by left click + mouse drag. . I saw something like API for Axis mouse and touch events is released.Can you tell what can be achieved with this.
(right now its right click + drag).
it's not working for Area range series.
setDataCleaningThreshold is new API that will be slowly introduced to existing series. With v3.0 it is only introduced for LineSeries and its derivatives (like PointLineSeries).
To prevent confusion, please refer to official API documentation to see if some method is supported - for example if we look at AreaSeries, it is not part of the API.
Also there is setMaxPointCount in Area range Series , what is the
difference between both ?
setMaxPointCount and setDataCleaningThreshold exist for the same purpose, and effectively achieve the same things, but they are based on slightly different ideas.
setMaxPointCount configures automatic data cleaning by specifying amount of data points to retain at the "head" of data.
setDataCleaningThreshold configures automatic data cleaning by specifying a coordinate on progressive axis. All data points that are "behind" this coordinate can be cleaned whenever convenient. This configuration is slightly preferred over "max points count" as it is more convenient for the rendering engine, and it also behaves slightly more logically - if you apply the fit() operation by dragging to top-left in chartXY with left mouse click, the axis will stop at data cleaning threshold, instead of showing all data including the data behind cleaning threshold.
Both of these methods will be supported for the time being and there should not be major differences between using either, so I recommend use whichever you feel more comfortable with.
Eventually the data cleaning configuration will settle down to a simpler API, but now we're still feeling how different users are using the library, and how we can optimize the performance best - so the API is a bit messy (as in, there are 2 methods for same purpose).
My charts are progressive and I want to clear the charts that are out
of view and make the charts faster.What is the best way ?
For AreaSeries setMaxPointCount is the only automatic option.
Please see the updated documentation on the method to learn more.
You can also implement manual data cleaning using dispose method, as you suggested.
However, please see if automatic data cleaning works for you first.

Application Insights Dashboard - Set Graph Dimensions?

I am currenty setting up a new dashboard in application insights to monitor our applications in detail. To do so, I am logging custom events from my application, and using a log query, I generate a Stacked Column Chart. Like so:
Chart. Notice that I am grouping on multiple dimensions, and the generated chart lets me pick which Dimension I want. (As documented here: https://learn.microsoft.com/en-us/azure/azure-monitor/log-query/charts#multiple-dimensions)
Now, when I pin this chart to my dashboard, I lose the ability to pick the dimension I want to see there. (Dashboard chart) Is there some way to retain this, or do I have to create and pin multiple charts, one for each dimension?
You are right. Changing the dimensions of existing parts are not supported yet.
We plan to support this in the future.
I'll ask here once we add this support.

Making independent graphs for different event types

The application insights APIs let you record custom events for user-defined purposes. They also let you record custom properties on those events.
The Application Insights chart control on the Azure Portal however, appears to have some annoying limitation.
Let's say we have two event names:
Login: A user logged in.
Work: The application started some expensive background job, which happens independently of any user action on various conditions.
Then I likely don't want those event types to be series in the same chart. In particular, I may want to do a grouping by user or something similar in case of Login, but that would make no sense for the Work type.
They really have nothing to do with each other and I'd like to have them in different charts.
I do, however, want them to be in the same chart control (the whole white rectangle thing that groups charts together and where you set the time scope and filters on).
The following missing features would each solve the problem:
If it was allowed to set a filter on individual charts rather than only the chart control as a whole.
If each event name would appear as a distinct metric to select.
I know there's also Analytics, but then I still don't have the new chart in the same old chart control.
Is there another option I overlooked?
There's no way to do this in any one specific metrics explorer window, like you said, filters apply to the whole window.
But you can do this by creating a dashboard, and pinning individual metrics explorer charts (or grids, or whatever) to that dashboard.
make a new dashboard, and name it something distinctive
create one of the charts you want with the right filters in a standard metrics explorer part.
pin that chart to the dashboard created in step 1.
repeat steps 2 and 3 to create each chart with its own settings
go to that dashboard, and resize / configure each chart the way you want it

How to animate 2D clouds in Unity3D?

I have 2D game and cloud sprites. I need to animate it. To clouds generate randomly e.g. in the left edge of the screen and move to the right edge of the screen. Clouds count must variate from 1 to 4 that can be visible on the screen simultaneously.
How can I do it? Just what do I need to use (write own script or Unity3D has a some tools already?
Here is a step by step guide to create randomly moving clouds in Unity
Create a prefab for the cloud sprite.
Create a new C# Script named CloudScript and Attach it to to the cloud prefab.
Add the code in this paste bin to the C# Script
http://pastebin.com/iX41mDui
Create an empty object in the scene and name it CloudManager
Add the code in this paste bin to the C# Script http://pastebin.com/s5nYdwaV
Set the public values for both scripts through inspector, based on preferences. For recommended values look at comments in code.
After this the script should work and make the clouds move across the screen at random heights and random speeds. All the comments in the code should pretty much explain to you how the whole thing works.
Just in case you need it, here's an example project with all the code in action https://www.dropbox.com/s/728v8ilzcvwff6e/RandomCloudMovementProject.unitypackage?dl=0

How can I make days wrap around in a QDateEdit?

The standard behaviour is, that as soon as the day reaches 31 the step-up button stops working. I'd like it to reset to 1 and jump to the next month.
I have not had the opportunity to test this, but I know that QDateEdit implements QAbstractSpinBox, so you should be able to call
myDateEdit.setWrapping(True)
which should accomplish what you want.
Doc Link
Update:
The term for this behaviour is apparently called "rollover" and here is one person's implementation, which (again, I haven't tested it) appears to be another potential solution:
Rollover QDateEdit
He makes the point that his implementation doesn't consider min or max dates though.

Resources