Change Y axis Interval in Amcharts - angular7

Am developing application in angular 7. I have added chart in my application using Amcharts.makechart, the version is 3.21.5. I want to change the Y axis interval label. Now my charts showing interval in Y axis (0.5, 1, 1.5, 2, 2.5,..). I want it to show (1, 2, 3, 4, 5, ....). How can I achieve this in Amcharts.
Am not trying to change the label with custom value. I would like to set Y axis value with specified interval/rounded value. I don't want it to be set decimal values.

Related

highcharts 7 issue with negative ticks

Highcharts upgrade from version 5 to version 7 is causing negative ticks on x and y axes even when no negative data exists. Various chart plots are wrongly displaying negative axes. Instead the expectation is that the axes must start at 0 (min: 0 is given) and must plot only the positive ticks (tickAmount: 5 is given).
This worked perfectly with version 5 but is behaving weird with version 7.
The left picture is version 7 chart. Look at the starting tick, -2.5, whereas there are no negative values, so it must start at 0. Also observe the last tick is not appropriate width as the other tick intervals and ends abruptly in between.
Here is the link for demonstration of the issue: https://jsfiddle.net/3awvyn0b/3/, see config for x-axis which is not being reflected in the plot:
xAxis: {
tickAmount: 5,
min: 0
},
If I remove tickAmount for the x-axis, the negative ticks are resolved but then the ticks are not correctly marked.
What has changed in version 7 that I need to handle?
Since this is a regression issue (bug report here: github.com/highcharts/highcharts/issues/13749#issue-641882231), the suggested workaround for now is to either
use even number of ticks on the chart. So instead of using tickAmount: 5 I'm now using tickAmount: 6 and that has resolved the negative ticks issue.
or along with the tickAmount (either odd or even tick number, as the need maybe) set endOnTick: true for the xAxis

Highchart - Chart type, gap in the x and y axis (0,0)

Please refer the fiddle codehttp://jsfiddle.net/yuvarajkumarg/az290eyq/1/
In Highchart of type Chart, when we plot for height = 0 and pressure = 2, we get a gap as shown in jsfiddle. I want point to be plotted on the X-axis(2,0). But the graph looks like it is plotted on (2,2) since the y-axis plot starts way above the x-axis. How to remove the gap ?
The issue is the categorized axis.
There are probably a few ways around the issue, but I would do it this way (on your xAxis):
tickmarkPlacement: 'on',
min:0.5,
max:6.5
Example:
http://jsfiddle.net/az290eyq/2/
You could also do it by not using categories, and using the axis label formatter in order to display the numeric sequence that you need.
[[ edit for comments:
For the min and max values - the x axis values for a categorized axis are the category array index values. So the first category is x = 0, the second is x = 1, etc.
Because Highcharts puts the the label in the center of the value's space, setting the min/max to the actual min/max value +/- 0.5 will align the center of the space with the start/end of the axis.
So, you can calculate this dynamically by using 0.5 for the min, and counting the categories array and using (count -1.5) as the max.
Additionally, setting the tickmarkPlacement proerty to 'on' moves the tick mark to the center of the space as well, aligning the ticks with the start/end of the axis as well.

How do I graph simple X-Y data in Teechart?

I'm using Delphi and Fast reports, specifically the TeeChart object inside Fast Reports.
I'm trying to plot a scatter graph (preferably with a line between the points)
Four points of typical X,Y data might look like this
X=10, Y=35
X=15, Y=40
X=23, Y=44
X=27, Y=8
I've set the X axis automatic to false and set a min of 0 and a max of 30.
However, when Teechart plots the points it plots the Y values at the correct height but puts them in X positions 0, 1, 2, 3 instead of 10, 15, 23, 27
This even happens when I hard code the data by setting 'Data Source' to 'Fixed Data' and putting 35;40;44;8 in the Y values box and 10;15;23;27 in the X values box.
How do I set up Teechart to plot the points at the correct X-Y coordinates?
You should use AddXY method, for example:
Series1.AddXY(10, 35);
Series1.AddXY(15, 40);
Series1.AddXY(23, 44);
Series1.AddXY(27, 8);
You should also be able to modify values like this:
Chart1[0].XValues[0]:=10;
Chart1[0].XValues[1]:=15;
Chart1[0].XValues[2]:=23;
Chart1[0].XValues[3]:=27;
Chart1[0].XValues[0]:=35;
Chart1[0].XValues[1]:=40;
Chart1[0].XValues[2]:=44;
Chart1[0].XValues[3]:=8;
That's how it should be done in TeeChart outside of FastReports. If none of those solutions works you might need to contact FastReports technical support.

how to set the interval of points on Y - Axis highcharts

I am using highcharts for the first time, and I am trying to figure out how to set the Y axis points static.I would like to know how to set y-axis values as -0.0000000001,0.00000000,0.0000000001 and so on in Highcharts.
I have used min=-0.0000000005 and max=0.0000000005 , and the points on y axis come up as 0,0.0000,0.0000... Wherein I want it as -0.0000000001,0.00000000,0.0000000001
You can use label formatter and Highcharts numberFormat then return correct values.

y value of candle doesn't match the real axis value

When I draw 2d candle stick series with the following simple code the Y value of open/close is 0 but it doesn't match the 0 of the axis. The former is 1 or 2 pixel higher than the latter(the grid of the axis).
Series1.AddCandle(0, 0, 1, -1, 0);
Is there any solution for this?
This is a bug I added to the defect list (TV52016642) to be investigated. For High and Low points you have two options:
1- Changing axis offset:
Chart1.Axes.Left.MinimumOffset:=-1;
Chart1.Axes.Left.MaximumOffset:=-1;
2- Changing axes minimum and maximum:
Chart1.Axes.Left.SetMinMax(Series1.MinYValue, Series1.MaxYValue);

Resources