Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay charts with two y-axis on opposites not displayed #21

Open
Johanneslueke opened this issue Jan 15, 2024 · 0 comments
Open

Overlay charts with two y-axis on opposites not displayed #21

Johanneslueke opened this issue Jan 15, 2024 · 0 comments

Comments

@Johanneslueke
Copy link

The Chart in Question:
image

Only the first y-axis of the first plot of the overlay function is honored!
My expection woud have been that both y-axis left and right were rendered.

the code to the chart:

 #let y_axis2 = axis(min: 0,  max: 200, step: 40, location: "left", show_values: true, title: "Mtl. Kosten (€)")
      #let x_axis2 = axis(values: ("","Jan", "Feb", "Mar", "Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"), location: "bottom", helper_lines: false, invert_markings: false)

      #let y_axis3 = axis(min: 0,  max: 2000, step: 400, location: "right", )
      #let x_axis3 = axis(values: ("","Jan", "Feb", "Mar", "Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"), show_values: true, location: "bottom", helper_lines: false, invert_markings: false)

      #let data = ( 
         (  "Jan", 156.95),
          (  "Feb", 156.95),
          (  "Mar", 156.95),
          (  "Apr", 156.95),
          (  "Mai", 156.95),
          (  "Jun", 156.95),
          (  "Jul", 156.95),
          (  "Aug", 156.95),
          (  "Sep", 156.95),
          (  "Okt", 156.95),
          (  "Nov", 156.95),
          (  "Dez", 156.95)
      )
    
      #let data_hist = ( 
          ( 156.95,    "Jan"),
          ( 156.95*2,  "Feb"),
          ( 156.95*3,  "Mar"),
          ( 156.95*4,  "Apr"),
          ( 156.95*5,  "Mai"),
          ( 156.95*6,  "Jun"),
          ( 156.95*7,  "Jul"),
          ( 156.95*8,  "Aug"),
          ( 156.95*9,  "Sep"),
          ( 156.95*10, "Okt"),
          ( 156.95*11, "Nov"),
          ( 156.95*12, "Dez")
      )

      
      
      // Combine the axes and the data and feed it to the plot render function.
      #let pl2 = plot(axes: (x_axis2, y_axis2), data: data)
      #let pl3 = plot(axes: (x_axis3, y_axis3), data: data_hist)
      
     #let monthly = graph_plot(pl2, (100%,20%))
     #let histo   = bar_chart(pl3,(100%,20%), bar_width: 50%)
     
     #overlay((histo,monthly),(100%,20%))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant