Skip to content

adding annotation to a plot #99

Answered by FlorianJacta
vfreysz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Thank you for your question! You almost have the correct syntax. What has to be passed to the layout is a Python dictionary. Here is how you define the dictionary:

test_anot = {
  "showlegend":True,
  "annotations": [
    {
      "x": 0.25,
      "y": 0.5,
      "xref": 'paper',
      "yref": 'paper',
      "text": traitement_std,
      "showarrow": False,
      "align":'left'
    }
  ]
}

I have also added "showlegend":True. You can find other options for annotations and text here. The Javascript dictionary has to be translated into a Python dictionary. And here is how you pass it to Taipy:

<|{dataset}|chart|x=Wavelenght (nm)|y=Intensity|layout={test_anot}|>

Now, the code should work.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vfreysz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants