How to make Highcharts chart always show PlotLines?

Question:

I would like to know how to make the graph based on the PlotLines value, without setting a minimum and maximum size for the graph. For example, I have a PlotLine for the X axis with a value of 30 and another for the Y axis with a value of 70. I didn't define maximum or minimum value for the graph, but when I have a point, for example, with the axes smaller than the value of the PlotLines, it does not display.

Does anyone know how to solve?

Note: I use the Scatter Chart

Below is the code for the X and Y axes:

xAxis: {
            title: {
                enabled: true,
                text: 'Audit e DDD'
            },
            //max: 200,
            //min: -200,
            //startOnTick: true,
            //tickInterval: 50,                
            //endOnTick: true,                
            showLastLabel: true,
            gridLineWidth: 1,
            plotLines:[{
                value: 70,
                color: 'red',
                width: 1,
                label:{
                    text: '70',
                    align: 'left'
                }
            }] 
        },
        yAxis: {
            title: {   
                enabled: true,             
                text: 'Visitação e conhecimento'
            },
            //max: 200,
            //min: -200,
            //startOnTick: true,
            //tickInterval: 50,                
            //endOnTick: true,                
            showLastLabel: true,
            plotLines:[{
                value: 30,
                color: 'blue',
                width: 1,
                label:{
                    text: '30',
                    align: 'left'

                }                    
            }]                
        },

Answer:

SORTED OUT

I solved the problem by adding an initial series, since my data is dynamic, setting the values ​​of the axes that correspond to each value of the plotLine, one pro X and one pro Y, this way, it will always load the graph with the defined plotLines.

Scroll to Top