Home forums Using CanvasJS Hide space between Candlestick/OHLC chart ?

This topic contains 5 replies, has 2 voices, and was last updated by  Skyline 9 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #19778

    Skyline
    Member

    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

    #19780

    Vishwas R
    Keymaster

    @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

    #19782

    Skyline
    Member

    Hi Vishwas,
    I will try to do as you suggest

    Thx
    Regards

    #19783

    Skyline
    Member

    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

    #19788

    Vishwas R
    Keymaster

    @skyline,

    You can apply customBreaks with spacing set to 0 as shown in this jsfiddle.


    Vishwas R
    Team CanvasJS

    #19789

    Skyline
    Member

    With some tweak using my data, it worked like a charm ;)

    Thx a lot !
    Regards

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.