highchart position label on xAxis value

12,877

You plotLine can have a label, take a look: http://api.highcharts.com/highcharts#xAxis.plotLines.label

Share:
12,877

Related videos on Youtube

Guian
Author by

Guian

SDK team leader at StickyAdsTV a Video Ad Platform designed for publisher. Working on client side components with Javascript, Android and iOS technologies

Updated on November 18, 2022

Comments

  • Guian
    Guian over 1 year

    Using highchart, is there a way to add labels according to particular x / y Axis values ?

    Using the highchart's labels, I'm able to write text at a given position in pixels, but I need to give a value from an axis as position.

    For example, in this jsFiddle I would like to set the label position on 'june', like the plot line.

    how can I do this?

        labels: { 
               items : [{ 
                   html : 'Summer starts here !' ,
                   style : { 
                       left: '10px', 
                       //I need to set the left position as an xValue : the timestamp for the summer start.
                       top: '100px'
                   }
               }] 
        }
    
  • Guian
    Guian about 11 years
    thx for your help, adding tickmarkPlacement: 'on', avoid to need the weird '4.5', instead 5 is june. its better. but it doesn't help in the label placement. I'd like the "summer start" label to be written on the june month.
  • Guian
    Guian about 11 years
    Exactly what I needed, thanks ! see the updated fiddle with this solution : jsfiddle.net/DdkDW/5