Skip to content

onclick function on x-axis labels and draw underline for x-axis labels. #525

Not planned

Description

@stardev24

Team,
As per my requirement I have to create a onclick function for x-axis labels and get label data inside function. Also draw underline for each of the x-axis labels.

How can I achieve this

Activity

  1. Arantiryo commented on May 10, 2022

    @Arantiryo
    Collaborator

    Hi @stardev24 👋

    Sorry for a late reply, but you should look into chart.js legend configuration options, specifically onClick event.

  2. dangreen commented on Nov 30, 2026

    @dangreen
    Collaborator

    Closing: this is about how Chart.js itself behaves or is configured, while react-chartjs-2 passes data, options and plugins to Chart.js as they are. The Chart.js docs cover it: https://www.chartjs.org/docs/latest/ If it turns out to be a bug, please report it to Chart.js: https://github.com/chartjs/Chart.js/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions