What if x and x2 values are same in X range highcharts - highcharts

I am using a x range chart in Highcharts.
I have dates in x axis. One of the data have both x and x2 same values. Means start and end date is same.
How will that be visible in the chart?

I think something that starts and ends exactly at one point in time is not good to represent in the x-range series. Here it is necessary to specify the exact duration. You can do this by adjusting your data accordingly, e.g. using Date.UTC (): https://jsfiddle.net/BlackLabel/9pjw0m8b/
data: [{
x: Date.UTC(2014, 11, 1, 0),
x2: Date.UTC(2014, 11, 1, 1),
y: 0
}]

Related

Change Y axis Interval in Amcharts

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.

Plot growth of 100 when return is given. Highstocks

I would like to populate a chart where y-axis is plotted as a growth of 1000. I.e., if I have a data say [01-Jan-2014,1.23],[02-Jan-2014,1.03],[03-Jan-2014,0.23]....[10-Aug-2014,-0.65]
Then my first point would be x: 1st Jan y: 1000 and next point is on x: 2nd-Jan y: 1000(1 + 1.03) next is x: 3rd-Jan-2014 y: 1000(1+1.03)(1+0.23)...and so on.
This should be the same even if I change the dates using a range selector. That is always my chart has to start from 1000 and the growth from that date should be plotted.
A working example of this using MS chart is present at this link
http://www.morningstar.in/mutualfunds/f00000pe1t/hdfc-top-200-fund--direct-plan-dividend-option/overview.aspx
How to achieve this using highstocks.

Displaying a point on another series in Highcharts (without flags)

I have a Highcharts instance [1] with 4 series. Two of the series are index/ratio series and two are raw value series. What I would like to do is display the raw value series points on one of the index series without converting the raw value series to 'flags'. The reason for this is that I want all my point values to be in one tooltip.
With respect to the attached jsfiddle I would like the center buy and sell points to appear on the 'Price Change' series and for the current tooltip behavior in the example to be unchanged. I want one tooltip with four values and for the buy/sell values to be their raw values instead of the 'y' value of where they are displayed.
Is that something that is doable with Highcharts/Highstock?
[1]: http://jsfiddle.net/eZL8e/
Dave
You can easily manipulate what you want to display in tooltip using pointFormat for each series. Then you can change fromat for point from [timestamp, value] to {x: timestamp, y: value, myProperty: exValue}. Simple example: http://jsfiddle.net/eZL8e/5/
For buys:
tooltip: {
pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.raw}</b><br/>'
},
data: [
{x: 1374555600000, raw: 21.13, y: 75},
{x: 1374642000000, raw: 20.5753, y: 85},
{x: 1374728400000, raw: 20.9367, y: 63}
]
Note: There is only one limitation for that solution, you need to disable dataGrouping, since grouped point's doesn't have custom properties like raw.

how to have a chart with no spline and no interpolation in Highcharts?

I am looking for a very basic kind of chart but I don't find it in the list, some sort of mix between 'columns' and 'line'. No interpolation/staircase.
Just imagine I am plotting the number of people in a room over time. I have points (t1, 10), (t2, 5), (t3, 15) where t1, t2, t3 are dates. I don't want the charts to linearly interpolate between 10 and 5 and between 5 and 15. I want something horizontal.
I was thinking of doing (t1, 10), (t2-epsilon, 10), (t2, 5), (t3-epsilon, 5), (t3, 15) but this is pretty dirty, I want a simple chart.
Columns look like they could do the job but I don't feel good about them.
Any suggestion ?
Thanks
This looks quite like High*stock*s step-line chart:
http://www.highcharts.com/stock/demo/step-line
Actually it is also possible for Highcharts Line chart. You can find reference here:
http://www.highcharts.com/docs/chart-and-series-types/line-chart
plotOptions: {
series: {
step: 'left' // or 'center' or 'right'
}
}

How to add a custom candlestick to highchart stock chart?

Using the Candlestick highstock chart,(http://www.highcharts.com/stock/demo/candlestick), I want to have the best last bar a custom candlestick where its available values are High and Low only? This is typical for a forecasting scenario where we would like to predict tomorrow's candlestick would likely to have a certain High (of the day) and Low (of the day). We are not so much concerned about its possible future open or close values. In the end, this (last) candlestick on the chart should look like a Line and not a bar.
Any idea much appreciated?
Use column/columnrange series, with pointWidth: 1. Setting example:
data: [{
low: 10, // low
y: 12, // high
x: date
}]
Another solution is to use scatter series with lineWidth: 1, for example:
data: [{
y: 10, // low
x: date
},{
y: 12, // high
x: date
}]

Resources