Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:47:42+00:00 2026-06-10T01:47:42+00:00

Using this example: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/demo/candlestick-and-volume/ When you hover over points on the chart, you get

  • 0

Using this example: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/demo/candlestick-and-volume/

When you hover over points on the chart, you get a nice vertical line showing you which point you’re currently on. I want to modify the click event so that the vertical line stays when I hover away after a click. Changing the line color would be ideal on click, but not necessary.

If I click another point I’d want to remove any previous lines. Any ideas on how I could accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:47:43+00:00Added an answer on June 10, 2026 at 1:47 am

    You can do it in several ways

    Highchart has a very cool renderer that allows you to add various graphics to the chart. One of the options is to add a path I will be illustrating the same here.

    We shall reuse the path of the crosshair and add the same to the chart with some additional styles like color you mentioned. The path of the crosshair can be optained as this.tooltip.crosshairs[0].d this is in string form and can be easily converted to an array using the Array.split() function

    click: function() {
        this.renderer.path(this.tooltip.crosshairs[0].d.split(" ")).attr({
            'stroke-width': 2,
             stroke: 'red'
      }).add();
    }
    

    This will accomplish adding the line. You can store the returned object into a global variable and then when you are about to add another such line, you can destroy the existing one by calling Element.destroy()

     var line;
     ...
     chart:{
        events: {
            click: function() {
    
                if (line) {
                    line.destroy();
                }
                line = this.renderer.path(this.tooltip.crosshairs[0].d.split(" ")).attr({
                    'stroke-width': 2,
                    stroke: 'red'
                }).add();
    
            }
        }
    ...
    

    Persist tooltip / crosshair on click @ jsFiddle

    Assuming you don’t have much meta data to be shown along with the line, this is the easiest (or the coolest 🙂 ) approach. You can also attach meta data if you want to using the renderer’s text object etc.

    An alternate way could be adding vertical plotLines to the xAxis

    UPDATE

    Refer my other solution to this question, that would work with zoom,scroll,etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using HighCharts 2.2.3 in an ASP.NET site. See http://jsfiddle.net/wergeld/TDLvc/ for code example. My site
From this example http://www.senchafiddle.com/#dPZn0 This displays a first panel, then a second one... using
I used this example (http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/) to upload file from android device to server, it
Im using phonegap + jquery + jquery iphone touch: http://www.midemos.com/demos/iphone/touch/?/iphone/touch/ Im trying to get
First Example: In the following example: http://jsfiddle.net/maniator/ScTAW/4/ I have this js: var storage =
I'm using this plugin: http://www.jeremymartin.name/projects.php?project=kwicks And my code follows this example: http://www.jeremymartin.name/examples/kwicks.php?example=7 I'm using
from this site there is header compress.h http://www.fredosaurus.com/notes-cpp/examples/compress/compress.html i am using visual c++ 2010
Well Im stucked at this point.please take a look at this http://jsfiddle.net/karthik64/5jhgF/3/ Okay first
Example: http://jsfiddle.net/forgetcolor/rZSCg/3/ Given a div set to overflow:auto, that will (likely) contain an image
I want to create this effect in mobile safari. http://jqueryfordesigners.com/demo/header-slide.html I'm using iScroll 4.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.