You must be logged in to post your query.
Home › Forums › Chart Support › Hide space between Candlestick/OHLC chart ?
Hi, I’d like to know if there’s a way to remove space when a financial series is shown (Candlestick or OHLC) using your pretty CanvasJS library. Infact is very normal that datetime on Axis-X aren’t consecutive due to weekend where there’s no data so there’s some hole in charts.
You can check what i’m talking about in your demo here : https://canvasjs.com/javascript-charts/ohlc-chart-json-data-ajax/
As you can see there’s spaces between 5-Jan-2017 and 8-Jan-2017, 12-Jan-2017 and 16-Jan-2017 and so on..
Is there a way to have consecutive candlestick shown on graph without any ‘space’ in between ?
Thx Regards
@Skyline,
You can use axis scale-breaks to remove the empty space. Also you can set spacing to 0, so that it looks continuous.
— Vishwas R Team CanvasJS
Hi Vishwas, I will try to do as you suggest
Hi Vishwas, i’m having hard time trying to figure out how to remove spaces on your demo. I’ve tried this code without any success :
axisX: { valueFormatString: “DD MMM”, scaleBreaks: { autoCalculate: true, spacing: 0 } },
Could you help me ? Thx Regards
@skyline,
You can apply customBreaks with spacing set to 0 as shown in this jsfiddle.
With some tweak using my data, it worked like a charm ;)
Thx a lot ! Regards
You must be logged in to reply to this topic. Login/Register