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

Boxplot Chart legend is trimmed when using multi-line legends and numerous colums #86

Open
EdwardCaulfield opened this issue Dec 20, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@EdwardCaulfield
Copy link

Describe the bug
When producing a boxplot chart with multi-line legends (using text arrays), the bottom of the legend is trimmed when there are numerous columns in the chart.

To Reproduce
In my example, I have 11 columns, of which 4 are multi-line and the legend is trimmed. When I only have 5 columns, the legend is not trimmed. I have experimented with manually adjusting the chart's height and width and this does not resolve the issue. If I manually adjust the chart height after it has been generated, however, the legends are shown correctly.

Using the options:

       @boxplot_options = {
        stroke: {
          show: true,
          curve: 'smooth',
          lineCap: 'butt',
          colors: ['#474038'  ],
          width: 1.5,
          dashArray: 0,
        },
        ytitle: "chart title",
        noData: {
          text: "no data",
          align: 'center',
          verticalAlign: 'middle',
          offsetX: 0,
          offsetY: 0,
          style: {
            fontSize: '14px',
          }
        },
        chart: {
          type: 'boxPlot',
          toolbar: {
            tools: {
              zoom: false,
              zoomin: false,
              zoomout: false,
              pan: false,
              reset: false,
            }
          }
        },
        title: {
          text: '',
        },
        tooltip: {
          enabled: false
        },
        plotOptions: {
          boxPlot: {
            colors: {
              upper: rgb(194,209,226),
              lower: rgb(35, 20, 94),
            }
          }
        }
      }

Because the data is proprietary, I am using legend text that has the same number of characters, but not exactly the same text. I don't imagine this should matter.

The chart legend is displayed correctly with the following data:

[[["Uuuuuu", " Innnnnnnn"], [12, 12, 12, 12, 12]],
[["FFFFFF-DD"], [13, 13, 13, 14, 14]],
[["VVVVVVVVVVVV"], [13, 13, 13, 13, 13]],
[["TTTTTTTTTT-DD"], [11, 11, 12, 13, 13]],
[["OOOOOOOOOOO", " HHHH"], [10, 10, 12, 13, 13]]]

The chart legend is chopped when using the following data:

[[["HHHHHH"], [9, 9, 11, 12, 12]],
[["UUUUUU", " Innnnnnnn"], [9, 9, 10, 12, 12]],
[["FFFFFF-DD"], [12, 12, 13, 14, 14]],
[["VVVVVVVVVVVV"], [11, 11, 12, 13, 13]],
[["TTTTTTTTTT-DD"], [9, 9, 11, 12, 12]],
[["TTTTT.", "& Vvvvvvv"], [11, 11, 11, 11, 11]],
[["Gggggggggg", " & Sss."], [11, 11, 11, 11, 11]],
[["Bbbbbbb"], [11, 11, 11, 11, 11]],
[["Oooooooooo", " Hhhh"], [11, 11, 13, 14, 14]],
[["Uuuuuu Dd"], [10, 10, 11, 12, 12]]]

The chart is generated with the statement:

box_plot_chart(@chart_data, @boxplot_options)

Expected behavior
All chart legends are clearly visible

Screenshots
Correctly displayed legend
grafik

Chopped legend
grafik

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser FireFox
  • Version 102.6.0esr (64-Bit)
  • Browser: Chrome
  • Version: Version 108.0.5359.124 (Offizieller Build) (64-Bit)
@EdwardCaulfield EdwardCaulfield added the bug Something isn't working label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant