Teechart chart Data issue - activex

I charting control we round off the data say if you have data as 1.3456 it is rounded off to 1.345 can we extend the digit after the decimal to 4 or 5.

you can use valueformat property for controlling decimal places
chart.GetAxis().GetLeft().GetLabels().SetValueFormat("0.0000") //for 4 decimal places
chart.GetAxis().GetLeft().GetLabels().SetValueFormat("0.00000")//for 5 decimal places
similerly for bottom axis as well.

Related

Duplicates in vertical axis in the Thingsboard chart

I am new to Thingsboard.
Today I created a chart to see temperature from a few sensors.
The problem is, I can see a few vertical marks which are the same:
I.e. two pairs of 28, two pairs of 26, etc.
As to me, it is quite strange… Maybe, it was designed this way, and I simply don’t understand why…
This is caused by rounding: By default, the Y-Axis doesn't show decimal values.
In this example, I have 4 Values: 20.1, 19.7, 20, 20 which are all rounded to 20 in the Y-Axis:
If you change the number of decimals displayed in the settings, it works as expected:

How do I draw a smooth line chart with ios-charts?

I'm using ios-charts Charts to draw a line chart. I'd like to draw a point every 10 min for a 24h period but my x-axis labels needs to show labels every 4 hours like: 12AM 4 8 12PM 4 8. The problem I run into is Charts complaining that the number of data points does not match the number of x-axes values.
What's the best way do do this type of chart? It can't be that hard. Maybe I just learn to love the warning?
make sure you add enough X values to conform the amount of Y values
use [xAxis setLabelsToSkip:23] (24 xAxis values for 10 min delta in 4 hours)
swift definition: public func setLabelsToSkip(count: Int)
Objective-C: - (void)setLabelsToSkip:(NSInteger)count

Highcharts: is there a way to offset lines slightly so same coordinates do not overlap?

I have a line chart with a limited Y axis (1-5). There are six different lines represented on the chart (3 each from two different users: measuring feeling 1, feeling 2 and feeling 3 from 1-5).
When users enter the same value over time (for instance, ranking feelings 1 and 2 as 5 for several weeks), the two lines completely overlap and you can only see one.
Is there a way I can offset a particular line by say, a couple pixels up and to the right so if there are two different lines representing same values over time, I can see both at once?
Using pointPlacement it is possible to slightly offset each series, so points with the same values do not overlap each other. The tooltip will still work as if points would overlap, so setting shared to true should help.
Example: https://jsfiddle.net/BlackLabel/3mhyojtd/1/
Another option that will allow not shared tooltip would be to use scatter type series with lineWidth set to 2, to imitate line type series.
Example with scatter series: https://jsfiddle.net/BlackLabel/r6pL4f2j/

Highcharts x axis custom scaling

I'm looking to use highcharts to create a graph with a custom (1/K) scaled x-axis for a chemistry application. I need the tick marks to be spaced differently, but not in a logarithmic fashion. For example, let's say I want the spacing between the 40 Kelvin x-axis tick mark and the 50 Kelvin tick mark to be 100px (arbitrary value), but then I want the spacing between the 140 x-axis tick mark and the 150 tick mark to be smaller than that (to be consistent with the scaling). The question is, how do I make the spacing between two tick marks (both 10 Kelvin apart) different sizes (to be computed with a formula)?
You should be able to do what you want using the xAxis tickPositioner function (http://api.highcharts.com/highcharts#xAxis.tickPositioner).

Which datatype should be used for long float values in iOS? [duplicate]

This question already has answers here:
Objective-C - How to increase the precision of a float number
(3 answers)
Closed 10 years ago.
In my application I am just dividing 50 by 3 I want to store the exact result value of this.
If I use float it gives 16.666666 and if i use double then it gives 16.666667.
Actually,I am creating three labels inside a frame by dividing the height of the frame I am deciding the height of each label. so I f i do not get exact value it creates a gap between labels.if if i pass 60 then it works fine because 60/3 results 20 but if I pass 50 then there is a gap.
If you want to make your frame divide into three equal-height areas, then the height of your frame in pixels needs to be divisible by three. You can't display fractional pixels, they are not divisible; each height as measured in pixels needs to be an integer number.
The only way to store an "exact" value would be to create a class called "Rational" (or similar) and store the numerator and denominator of the fraction as separate ivars. Floats and doubles (or any literal computer representation for that matter) cannot store rational numbers with an infinite number of decimal places or transcendental real numbers.
The way to use the "Rational" class would be to store the numerator and denominator, and then apply the appropriate maths to these values (if you wish to propagate "exactness" through the program). The slightly easier way would be to display the rational number as numerator and denominator but use the float/double approximation for the underlying mathematics.
float t= (float)50/3;
long double t1= (long double)50/3;
NSLog(#"%.30f %.30LF",t, t1);
produced output "16.666666030883789062500000000000 16.666666666666666666088425508008".
I would suggest you to go with long double which is not exact but precise enough.

Resources