Giter VIP home page Giter VIP logo

Comments (5)

y-takey avatar y-takey commented on June 14, 2024

@arunfancraze Although I haven't tested it, I think you can achieve a simple solution using the following approach:

import type { ExtendedChartData } from 'chartjs-plugin-stacked100';

formatter: (value, context) {
  const data = context.dataset.data[context.dataIndex] as ExtendedChartData;
}

from chartjs-plugin-datalabels.

Arun-chaitanya avatar Arun-chaitanya commented on June 14, 2024

Hi @y-takey, This solution works. You can mark this as closed. Thanks.

from chartjs-plugin-datalabels.

y-takey avatar y-takey commented on June 14, 2024

Hi @Arun-chaitanya, Thank you for trying it out! I'm glad it worked and the issue was resolved. :)
but, it seems that I am unable to close it due to insufficient permissions.

from chartjs-plugin-datalabels.

simonbrunel avatar simonbrunel commented on June 14, 2024

I would say it's an issue with the chartjs-plugin-stacked100 package which should probably augment the ChartData core type. @y-takey Maybe you could try something like that in your types.ts:

import {ChartData} from 'chart.js';

declare module 'chart.js' {
  interface ChartData< 
    TType extends ChartType = ChartType,
    TData = DefaultDataPoint<TType>,
    TLabel = unknown
  > {
    calculatedData?: number[][];
    originalData?: PluginDataPoint[];
  }
}

// Backward compatibility
export type ExtendedChartData = ChartData; 

from chartjs-plugin-datalabels.

y-takey avatar y-takey commented on June 14, 2024

@simonbrunel Thank you for the advice. I would like to try it when I have some time! :)

from chartjs-plugin-datalabels.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.