score:0
after beating my head against the table for a few hours it seems that this may just be the intended behavior of datalabels.
i managed to "solve" it pretty simply like this:
profit = profit.replaceall("-","");
the negative can be added back in later using the formatter. in my case, i use a different data object when profit is negative, color it red, and change the "profit" heading to "loss". solved well enough!
Source: stackoverflow.com
Related Query
- ChartJS Datalabels plugin and negative numbers
- chartjs datalabels change font and color of text displaying inside pie chart
- How to properly use the chartjs datalabels plugin
- Datalabels plugin chartjs showing '[object]' instead of value
- Can't apply options of datalabels chartjs plugin in Vue
- chart.js? Specifically Radar Charta and Negative Numbers
- chartjs plugin datalabels does not show value on charts
- Can't Draw Horizontal Line on Graph Using ChartJS Annotation Plugin and Primevue Chart
- Using Datalabels and ChartJS with Chartjs-node-canvas
- add a unit to label with chartjs plugin datalabels
- Chartjs annotation plugin colored box colors get summed after switching back and forth
- Chartjs v2 - format tooltip for multiple data sets (bar and line)
- ChartJS canvas not displaying rgba colors in IE, Safari and Firefox
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chartjs displays numbers not time
- angular 5 chart.js datalabels plugin
- Django and ChartJS
- Change point size and color on hover in chartjs
- ChartJS and jsPDF - why the background is black?
- how to change background in chartjs and remove background lines?
- chartjs - top and bottom padding of a chart area
- How to change the color of legend in chartjs and be able to add one more legend?
- Usage of ChartJS v3 with TypeScript and Webpack
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- How to remove gridlines and grid labels in Chartjs Radar?
- How to feed hour and minute data into chartJS
- Chartjs Datasets overlapping and z-index
- Create a rounded bar graph with Angular and chartJS
- Displaying mixed types of legends (bar and lines) with Chartjs
More Query from same tag
- Is it posssible to create a Line-Chart with only 2 values? - Chart.js
- Where can I download a certain version of d3.js for angular?
- Chart JS date-hour AxesX
- In chart.js, how to know if a yAxes tick is bumping/rendering over/into another
- How to plot multiple value for one X-axis chart.js
- Return 0 when some information DOESN'T EXIST (not when exists and return null)
- Is Chartjs compatible with PhoneGap?
- Angular2 Update ng2-charts with labels
- Key Management: Hardcoded Encryption Key for chart.js
- Chart.js legend customisation
- Add bar chart in a column
- How do I display chart on my HTML page based on JSON data sent by Node JS
- How to put 2 labels and distinct tooltips from two bars
- Having trouble fetching data from database for chart in ASP .NET Core
- Multiple Charts of the Same Type in ChartJS2 ReactJS - Buggy Tooltips
- How can I put sign (%) on data in ChartJS?
- References in axis using chart.js (or another library)
- ChartJS, nested flexbox, not shrinking
- Stacked bar chart with chartjs with included values
- Reference Javascript variable in JSON
- Moving Data To Object Within Array
- ng2-charts : Newly added rows not getting displayed on phone devices
- Custom label from using separate array in Chart JS
- Set different color for each bars using ChartJS in Angular 4
- Where do i add the begin at zero (chart.js)
- Using chartjs v2 to show categorical values on axis instead of numeric
- Remove top horizontal line in a horizontal bar chart (Chart.js 2)
- ChartJS, updating chart type does not update xAxis properly
- Chart.js tooltip at any point on the chart
- Hiding spaces with zero values in bar chart with chart.js