Skip to content

Y-Axis Labels #67

@jra457

Description

@jra457

It would be great if the left side of the plot could be labeled with the data names of each line.

User story

Users would be able to quickly gain insight into what the plot was representing if the data labels were shown. Then they would be able to hover over the lines that correspond to the specific data users are interested for the actual values.

Additional context

I was able to add some of the words represented in the plot by adding them to the ticks on the y axis in options. This did lead to a gap between the left most edge of the plot and the start of the actual plot, most words were left out using this method, and the words were not properly aligned with the corresponding line.

    const chart = new Chart(ctx, {
      type: 'pcp',
      data: {
        labels: pcpWords.map((c) => c.word),
        datasets: attrs.map((attr) => ({
          label: attr,
          data: pcpWords.map((c) => c[attr]),
        })),
      },
      options: {
        scales: {
          y: {
            type: 'linear',
            position: 'left',
            title: {
              display: true,
              text: 'Words'
            },
            ticks: {
              callback: function (value, index) {
                return pcpWords[index].word;
              }
            }
          }
        }
      },
    });

Screenshot 2024-07-25 113319

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions