How to add margin between the value and graph on MPAndroidChart - 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.

Related

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.

SSRS line chart

I have one question to the line chart.
I would like to create a line chart, which values are given. It should look like this chart here:
My question is, how can I implement this. I tried to put it as a stripline in the chart but it only shows a horizontal line without this steps at the beginning.
How can I create this line chart like in the picture above?
can I put into this:
the values.
Striplines are intended to display just a line across the chart, or varying width, height, to demonstrate an area... from MSDN
Strip lines, or strips, are horizontal or vertical ranges that shade the background of the chart in regular or custom intervals
To get the behaviour (I think) you require you can add a new series to the data you are returning with each of those datapoints. Irrespective of what other data you are charting, you can change the type of this series to Line Chart, and change the order of the series on teh chart to make it uppoermost.
Without further information - such as the data you are tyrying to superimpose this on - it's hard to advise further.

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

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.

dojox.charting: how to align the plotArea of 2 charts, one above another?

I'm trying to layout 2 linked charts, one above the other, similar to what you might see on the Google Finance page.
I can render both charts just fine, but getting the plotAreas to line up exactly is a bit of a mystery. The chart.plotArea.width of each chart seems to depend on the width of my Y axis labels. Thus the 2 charts are not the same width and have different values for chart.getCoord().l.
Right now, I'm using an offset which is manually calculated, but there must be a better way.
this.chart.render(); // top chart, getCoords().w=800
// manually set margins for lower chart to match
this.chartVol.margins.l = this.chart.offsets.l - 59 + 10;
this.chartVol.margins.r = this.chart.offsets.r - 31 + 10;
// render bottom chart
this.chartVol.render(); // bottom chart same width, getCoords().w=800
There are two simple ways to do it:
Use maxLabelSize and labelFunc. The former is the maximal label's size in pixels. The latter is a function, which takes a number, and returns a corresponding string label.
Use labels, which is an array of {value, text} objects, and include one long dummy string of desired size at the end with some bogus value.
I don't recall how to do it without custom labels, so if you feel like it is really needed, please submit an enhancement ticket.