score:1
Try this for the line chart:
var originalLineController = Chart.controllers.line;
Chart.controllers.line = Chart.controllers.line.extend({
draw: function() {
originalLineController.prototype.draw.apply(this, arguments);
/* own drawing code here */
}
}
You can get the context with:
var ctx = this.chart.chart.ctx;
score:3
A bit late answer but you can extend the shape of the element, not the type of the specific chart, from v2.
For example,
Chart.elements.Rectangle.prototype.draw = function() {
// Do your draw thingy.
}
There's an issue regarding this one at the official Github repo and also a great example of implementing it.
Source: stackoverflow.com
Related Query
- Extending Existing Chart Types angular chart js using chart js 2.0
- Create multiple dynamic stacked chart using chart.js in Angular 10?
- Show labels on each sector to polar chart using angular js chart
- How to show percentage (%) using chartjs-plugin-labels ( Pie chart ) in angular 2/8
- Using two JSON objects to make Chart.JS Bar Chart Dynamic in Typescript / Angular
- How to send data to chart js using angular
- how to increase space between legend and chart in chartjs (ng2charts ) using angular
- Chart.js chart doesn't render when using Angular 2
- How to display the values inside the pie chart of PrimeNG (chart) using JavaScript or Angular
- Bar Chart in Angular JS Using Chartjs
- How to show symbols after the label and before the numeric value using chart.js Bar chart in Angular
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Building Multiple Charts Using Chart JS in an Angular Application
- How Can I Get An Instance of a ChartJS Bar Chart Using Angular
- How to display Json object in chart js consisting of lists created using Django rest framework in angular application
- How to take data from an API and create a chart on that using Chart.js and Angular 8?
- how to create line chart using chart.js in angular 2+
- Pie chart not working using angular and ng2-charts
- How to run Chart.js samples using source code
- Angular 4: Different color for bar in bar chart dynamically using ChartJS
- How to add text inside the doughnut chart using Chart.js?
- How can labels/legends be added for all chart types in chart.js (chartjs.org)?
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- Moving vertical line when hovering over the chart using chart.js
- create a multi line chart using Chart.js
- Using Chart.js on Angular 4
- How to add an on click event to my Line chart using Chart.js
- Display line chart with connected dots using chartJS
- Dynamically update the options of a chart in chartjs using Javascript
- Adding trendlines to existing chart Chart.js
More Query from same tag
- The dataset in ng2 charts for bar graph is not setting properly
- ChartJs showing wrong labels of data (x-axis dates)
- Problems trying to render some data on chartjs
- chart js -data on chart in rotated form
- Animated Word Web in Javascript
- ERROR : syntax error, unexpected '$app' (T_VARIABLE), expecting ')'
- Are you able to offset a secondary y-axis in ChartJS, by a decimal value, whilst keeping the same scale for both y-axes?
- Can't get if else statement in tooltip label to work in chartjs
- How to draw lines between minimum and maximum value to average value in chartJS?
- ReactJS - Labeling multi dimension array with chartJS-2
- Problem with script src for Chart.js. The CDN for Chart.js funtions fine, so my code is ok. Somehow I'm not linking the file correctly
- How do you output the correct value for Chart.js Radar graph on label?
- Add images inside bar chart in chart.js
- Chartjs - Shift line plot to the right?
- angular-chart.js showing black color chart in Firefox, Safari, and IE
- Get data from sql database in chartjs using codeigniter
- Chart js: Update line chart having two data sets
- Chartjs - how to change the notation of doughnut chart
- how to calculate the number of columns in a database with specific values (Query)
- Charts in wicket
- Side effects from Chartjs for only *some* clients
- Chart.js canvas keeps shifting upwards if I add things below it? (Angular - Chart.JS - NG2Charts)
- Creating and Updating Graph in HTML and Javascript
- Chart.js - How To Show Value of Label as Percent of X and Y Values - Currently Always 100%
- How to apply gradient color in chart.js?
- How to use date in x value for Object[] in chartjs dataset, I am getting an error: 'TS2322: Type 'string' is not assignable to type 'number'.'
- Chart.js add label inside bubble chart
- Chart JS no animation line chart
- Chart.js - Hover labels to display data for all data points on x-axis
- Data with x and y data, missing data are not taken into account