samadhan17
Posts: 25
Joined: Mon Mar 09, 2020 9:37 am

How to start first column of waterfall chart from some reference point

Hi, I need to start waterfall chart from some reference value not from 0 of y-axis.
How to start from some say 50 reference point of y-axis and further columns will take this 50 as reference and it will plot above that reference value.
As per below code, my first column should start from 50 from y -axis to 180 (50+130 it's height).
How to achieve it, please help.
or if any dummy data that I should to show only dash line at 50 for first column and will not draw column.

Code: Select all

 {
            chart: {
                zoomType: 'xy'
            },
            series: [{
                    type: 'waterfall',
               
                    data: [{x:1647958545 , y:130}, {x:1647958563 , y:330}, {x:1647958585 , y:-40}],
                    colorByPoint: true
                }],
            xAxis: {
                type: "datetime",
                max: maxDate, //these are updating on scroll axis
                min: minDate,//these are updating on scroll axis
                scrollbar: {
                    enabled: true
                },
                labels: {
                    formatter() {
                        return Highcharts.dateFormat(xLabelFormat, this.value);
                    }
                }
            }
        };
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: How to start first column of waterfall chart from some reference point

Hello,

You can create a dummy point that you hide and set xAxis.min on the second point y position.
Demo: https://jsfiddle.net/BlackLabel/vh2azfdw/

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”