pnp / pnp/sp-dev-fx-controls-react

Not able to show data labels in any chart from PnP ChartControl.

Open
#1,274 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted type:enhancement
Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

Category

[ ] Enhancement

[ ] Bug

Version

Latest (3.9.0)

Expected / Desired Behavior / Question

I am using @pnp ChartControl in my project where I am creating a pie chart. My expected result is to show labels on the chart itself. I tried my best to show datalabel on the chart but could not get any way.

Observed Behavior

I installed extra library(i.e. chartjs-plugin-datalabels) for enabling Datalabels on chart but now luck. I have gone through Chart.js documentations where it mentioned that this library only work with Chart.js v3.0 or higher. I can see "chart.js": "2.9.4" in package.json file of SPFx-pnp-controls from the repo. That is why library is not compatible.

image

Requesting to add datalabels on the PnP ChartControls.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting package.json for the Chart.js version and then trace the PnP ChartControl entry point to see how chart options and plugins are handled. Verify the approach with a pie chart using the reported Chart.js 2.9.4 dependency; done means chart controls can display data labels without breaking existing charts.

Written by the indexing model from the issue text.

Assessment

Tech stack
chart.js, react, typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.