luxmij
Posts: 1
Joined: Tue Nov 20, 2018 12:18 pm

Highstock xAxis.ordinal=true not working

I need to remove the gaps created during weekends / flat days.
I tried adding xaxis. ordinal = true. But it didn't work. I am plotting a candlestick chart.

Below is my code.

Code: Select all

   var chart = Highcharts.stockChart({
            chart: {
                renderTo: 'highchart-span',   
                events: {
                    load: function () {
        
                        //---get new tick                                               
                            get_new_tick(this.series[0]);                                                                                       
                    }
                }          
            },
            navigator: {
                margin: 2
            },                   
            rangeSelector: {
                allButtonsEnabled: true,
                selected: 2
            },
    
            title: {
                text: 'STOCHASTIC'
            },  
            xAxis: {
                ordinal: true
            },              

            series: [{
                type: 'candlestick',
                name: 'STOCHASTIC',
                data: content,
                dataGrouping: {
                    units: [
                        [
                            'week', // unit name
                            [1] // allowed multiples
                        ], [
                            'month',
                            [1, 2, 3, 4, 6]
                        ]
                    ]
                }
            }]
        });  
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: Highstock xAxis.ordinal=true not working

Hi luxmij,

Could you prepare a simple demo (jsFiddle for example) to work on it? From your code is hard to understand how your desired chart should look like.

Best regards!
Sebastian Wędzel,
Highcharts Developer

Return to “Highcharts Stock”