Home forums Report Bugs Unable to get points for the bar chart to hover

This topic contains 5 replies, has 2 voices, and was last updated by  Vishwas R 8 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #19643

    shikha
    Member

    Hi I am unable to hover over the bars of bar chart using java script. I need to hover over the bars so that I can click on the tool tip. A same replication of the graph is in this url- https://demos.telerik.com/kendo-ui/chart-api/index.
    In this graph clicking on the tooltip may not be possible but getting the value is possible.

    Could you please help me out with this as I am stuck with this and its urgent.

    Thanks in advance

    #19646

    Vishwas R
    Keymaster

    @shikha,

    Are you looking for adding hyperlink in toolTip? If so, you can do that using toolTipContent as shown in the second example in toolTip page.

    If this doesn’t solve your requirement, can you kindly create jsfiddle along with sample data, so that we can understand it better and help you out?


    Vishwas R
    Team CanvasJS

    #19647

    shikha
    Member

    Could you please tell me how to get the data points for the bars so that I can perform action on it like hovering on it through java script as there is no id attribute that i can use.

    #19648

    Vishwas R
    Keymaster

    @shikha,

    Events are not being captured in toolTip. So overriding style to toolTip class should work fine in your case. Please try adding following CSS.

    .canvasjs-chart-tooltip, .canvasjs-chart-tooltip > *{
         pointer-events: auto !important;
         -webkit-user-select: auto !important; /* Safari 3.1+ */
         -moz-user-select: auto !important; /* Firefox 2+ */
         -ms-user-select: auto !important; /* IE 10+ */
         user-select: auto !important; /* Standard syntax */
      } 

    Also please take a look at mouseover event handler function where you can get dataSeries, dataPoints, etc values just by hovering on dataPoint.

    Vishwas R
    Team CanvasJS

    #19652

    shikha
    Member

    Actually I need to automate this kind of graph. For that I am using java script so that I can get exact points for the graph elements to hover on it. So I don’t have any control over the development of the graph. My question is which method should I use so that I can get the datapoints where i can hover?

    #19655

    Vishwas R
    Keymaster

    @shikha,

    You can use convertValueToPixel to get pixel coordinate of the given value on the axis and convertPixelToValue to get the value along axis for the given pixel.

    However can you kindly create jsfiddle along with sample data, that helps us understand your scenario better by checking out the chart-options being used and help you out?


    Vishwas R
    Team CanvasJS

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.