How do you modify a waveform graph in labview to display the time axis in milliseconds instead of seconds? - labview

In the following LabView diagram:
The waveform I get looks triangular, but I am expecting it to look more like square pulse waves. How can I change the time axis to display in milliseconds instead of seconds?

You can change the display of the x-format to %<%3u>T, this is selectable from the properties.
This however will add a decmal sign to the timestamp.

I don't think you can, but you can change the display format of the X-axis. Right-click on the indicator, select Properties and, on the Display Format tab, set the type to Floating point, Digits to 3 and Precision Type to Digits of precision. Then, double-click the 0.1 on your X-axis and set it to 0.001. You can make the X scrollbar visible to be able to see the whole graph.
You also appear to have missed the point on the selected frequency and width indicators in another post. You don't need them; you can make the Digital Display visible.

Related

How to add margin between the value and graph on MPAndroidChart

The value is too close to the graph so I want to add margin.
My Graph
I would also like to position the text at the bottom of the line when the value is low.
Like this:
What I would like to achieve
Googling how to offset value and apply margin but can't find enough sources.

valign images in xlsxwriter cell

Is there any hack for v-aligning images in a cell
I am trying to create a dashboard,those traffic lights are images.
Since once of the columns is a text-wrap and the height of those rows
are dynamic, I have no way of knowing the row height to calculate the y_offset for those images
Does anyone have a recommendation on how I can handle this? Is there a way of getting the row_height after sheet.write and text_wrap format is applied?
Is there a way of getting the row_height after sheet.write and text_wrap format is applied?
Probably not without access to Windows APIs for calculating bounding boxes for strings.
You could probably make some working estimates based on the length of your string. Each new line in text wrap is equal to 15 character units or 20 pixels.
Since once of the columns is a text-wrap and the height of those rows are dynamic, I have no way of knowing the row height to calculate the y_offset for those images
This is the main problem. In order to specify the image position exactly you will need to specify explicit row heights so that XlsxWriter can calculate where the image will go based on the size of the cell. In order words you will have to avoid the automatic row height that Excel gives you when wrapping text.
Once the row height is fixed you can position images exactly where you want them using the 'x_offset' and 'y_offset' options.
Note, you can also use conditional formatting to create traffic lights based on cell values. See Sheet9/Example 9 of this code from the XlsxWriter docs and image below. These can be centered automatically even with with text wrapping.

Is it possible to add a horizontal line to an infragistics ultraSparkLine that isn't an average

I am new to using infragistic controls. I have added a ultraSparkLine to a VB 2017 application. I am doing it using in Area format. It is displaying work being accomplished during time frame. Want I would like to do is add a horizontal line that would show target rate of what is expected as work rate. I see I can have the Trendline but that seems to show average work rate for time frame being displayed.
Is it possible to add a horizontal line at a predetermined value?
There is no build in way to draw horizontal line. However you can use normal range to make something like a horizontal line. First set minimum and maximum to your chart. This will allow you to show the horizontal line above/bellow the spark line. Then set NormalRangeMaximum and NormalRangeMinimum to some very close values. For example if minimum is 0 and maximum is 100 I would set the ranges to let say 89.9 and 90.
As a final touch you can set NormalRangeFill to some brush as needed in your application.

How to make box thinner in pyplot.boxplot

When I use boxplot, only for one set of data (i.e. one array), my box is actually stretched to the entire width of the window:
screenshot of result
I tried to use "widths"-parameter in plt.boxplot but it does not change anything:
code's screenshot
I would like make the box thinner (let's say 30% of window or so). What I am doing wrong?
You can use:
plt.tight_layout(pad=10)
#10 spaces in font size units between figure and window border
plt.show()
The x axis is autoscaled to the range of the box' extention. This problem seems to only occur in matplotlib versions prior to 2.0.
One easy way to avoid this is to set some limits on the xaxis, like
plt.xlim(0.5, 1.5)
One may then play around with the limits until it looks most appealing.

Is it posible to get the position of point on an excel graph axis

I'm not sure this is possible but thought this was the best place to ask.
Is it posible to get the position of a series value on a graph in excel?
For example, if I have a line graph in excel that has time along the x axis, is it possible to (using VBA) get the position of a specific point on that axis.
What I am trying to do is have a vertical line that is can be positioned based on a date entered by the user.
like this
Where the green line could be positioned by entering in a date (rather than just being manually moved) (or also it could be set to automatically move to the current date etc).
I was then thinking that if the position is on the graph is queryable, then I can just access the line object and move it to any position I wanted through VBA.
Any Ideas? or is this just not possible?
The "cleanest" way to do this is to add the line to the chart as a new series. In that way, Excel handles all of the positioning and your work is simplified. To get a vertical line on a chart, there are a number of options. I prefer this route:
Create a small 2x2 area with two dates and two values
Add in the date or x-axis value you want the line at (E3 in image). You can use =TODAY() here or some manually entered value.
Set the second x-axis value equal to the first
Use MAX and MIN on the data to get the values for each date. You can also use 0 and 1 and a secondary axis, but I think MAX/MIN is easier.
Add the data to the chart and format as a marker with straight line.
Formulas
E3: =TODAY()
E4: =E3
F3: =MIN(C3:C27)
F4: =MAX(C3:C27)
Result and chart data series for vertical line