javascript - How to display plotlines when only one value exists -


i have issue display of plot lines in line chart drill down.

every thing works fine, when drill down on year 2015 (where have 1 value per line), plot lines not show.

i have read issue in this post solutions not acceptable disable auto-scale on yaxis.

here happens :

the normal chart (before drill down). works perfectly:

the normal chart (before drill down)

the chart drill down on 2014 (where have 4 values per line). works perfectly:

the chart drill down on 2014 (where have 4 values per line)

the chart drill down on 2015(where have 1 value per line). plot lines not show , 2 points @ same position:

the chart drill down on 2015(where have 1 value per line)

here how initialize chart :

/*initialisation du chart*/             chart = new highcharts.chart({                 chart: {                     renderto: instancedata.id,                     type: 'line',                     alignticks: false                 },                 title: {                     text: titre_drill                 },                 subtitle: {                     text: soustitre_drill                 },                 legend:{                     enabled:true                 },                 xaxis: {                     type: 'category'                 },                 yaxis: [{                     title: {                         text: texte_ordonee_expedie,                         style: {                             color: color_expedie                         }                     },                     plotlines : [{                         value : seuil_expedie,                         color : color_expedie,                         dashstyle : 'shortdash',                         width : 2,                         label : {                             text : ''                         }                     }],                     labels: {                         format: '{value} €',                         style: {                             color: color_expedie                         }                     },                     gridlinecolor: 'transparent'                 },                 {                     title: {                         text: texte_ordonee_packee,                         style: {                             color: color_packee                         }                     },                     plotlines : [{                         value : seuil_packee,                         color : color_packee,                         dashstyle : 'shortdash',                         width : 2,                         label : {                             text : ''                         }                     }],                     labels: {                         format: '{value} €',                         style: {                             color: color_packee                         }                     },                     gridlinecolor: 'transparent',                     opposite: true //pour que le deuxième axe soit à l'opposé du premier                 }],                 plotoptions: {                     line: {                         cursor: 'pointer',                         marker: {                             symbol: 'triangle'                         },                         datalabels: {                             enabled: false                         }                     }                 },                 tooltip: {                     formatter: function() {                         return '<b>'+ this.y +'</b> €<br/>';                     }                 },                               series: main_data,                 drilldown: {                     series: drilldown_series,                     drillupbutton: {                         relativeto: 'spacingbox',                         position: {                             y: 0,                             x: 0                         }                     }                 },                 exporting: {                     enabled: true                 }             }); 

i know there not native function in highcharts "always display" plot lines. have suggestion can display 2 plot lines in drilldown on 2015 ?

if want show plotline on point automatic scaling not show...you have disrupt automatic scaling. there no way around plot line.

what can work automatic axis scaling use line series instead of plot line.
if want behave plot line , not series, can disable legend entry, tooltips, etc.

this way, axis automatically scale include line(s).

example:


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -