BenjiG
Posts: 11
Joined: Fri Dec 03, 2021 10:37 am

Annotation

Hello,

In order to refine my graphs, I want to put annotations on my graphs in very precise places.

So I simply added the following lines to my code:

Code: Select all

   annotations: [{
        draggable: '',
        labelOptions: {
            backgroundColor: 'rgba(255,255,255,0.5)',
            verticalAlign: 'top',
            y: 15
        },
        labels: [{
            point: {
                xAxis: 0,
                yAxis: 0,
                x: 1642397828000,
                y: 4
            },
            text: 'TEST'
        }]
    }],
So I was hoping that on my graph at the exact time I wanted 17/01/2022 06:35:00 and 4 on the temperature axis, the TEST annotation would appear but this is not the case.

It is quite difficult for me to set up a code, but on my link if you do F12 with the browser you may see the errors that appear as an attachment.
Here is the graphic: https://raspigournayaronde.sytes.net/Gr ... phique.php

Thanks in advance!
Capture.JPG
Capture.JPG (43.71 KiB) Viewed 440 times
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Annotation

HI,

Thanks for contacting us with your question!

What version of Highcharts Stock do you use? Are you sure that all modules are added correctly?
Could please reproduce the issue in an online editor that I could work on? You can start here: https://jsfiddle.net/BlackLabel/prqctk7f/

Regards!
Magdalena Gut
Developer and Highcharts Support Engineer
BenjiG
Posts: 11
Joined: Fri Dec 03, 2021 10:37 am

Re: Annotation

Thanks for the answer!

For the modules, I directly put the links to highchart annotations.js and accessibility.js for testing in my script tags. That's enough, isn't it?

As for the version, it is the latest Highcharts JS v9.3.2, at least my highstock file is in that version.

I'll try to put the code, I know it would be the easiest but as it's a code I've already got and it connects to 1 big database it's hard to make it a simple code for me ^^
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Annotation

Hi,

Yes, that should be sufficient.

At your provided sample I've noticed that a link is to the very old version Highstock JS v1.3.9 - https://raspigournayaronde.sytes.net/hi ... ghstock.js and I'm almost sure it could be the most likely scenario of the appearing errors.

Could you please check it again and use the following link instead?
https://code.highcharts.com/stock/highstock.js

I perfectly understand that reproducing this example won't be the easiest one, but if we exclude that the problem is with the version, it will be necessary.

Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Stock”