score:2
so, per the chart.js documentation, http://www.chartjs.org/docs/#doughnut-pie-chart-data-structure
for a pie chart, you must pass in an array of objects with a value and an optional color property
it turns out the color property is not so optional after all. sure, the chart will render fine (as in all black pie slices, divided by white segment stroke color, pretty bad looking by default) with no javascript errors. but, when you mousemove and mouseout of the pie, the colors magically change to white (with the same white segment stroke color), rendering the whole pie chart invisible against a white background, with only the tooltips showing on mousemove, mouseout.
the documentation of chart.js should either make a note of this behavior, or make color a mandatory property or add good default colors, that don't change magically with mouse events.
but till then, users should assume the color property is mandatory to prevent headaches.
this is significant, as many developers will want to massage the data json returned from server to add ui related info, to keep the server side free of any ui logic.
Source: stackoverflow.com
Related Query
- PieChart disappears on mouseout
- How to run Chart.js samples using source code
- Chartjs Doughnut disappears
- Chart disappears just after finishing animation
- Add mouseout event handler to legends in Chart.js
- How to add ChartJS code in Html2Pdf to view image
- Change font family of labels in piechart and linechart in chartjs
- Chart.js disappears on Android
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- My chart.js canvas disappears after hide() function
- Chart.js - PieChart defined background color for specific dataset element
- code works fine on jsfiddle but one function is not working on website
- Chartjs not working with d3 from csv source
- Chart.js / Javascript How to Override Mouseout Event Listener
- Passing an Array from a Flask view to the javascript code of another view
- How to generate color code dynamically by swapping 2 characters within a string using PHP
- Code doesn't work after updating chart.js versioning
- Chart.js only appears randomly, and disappears on page refresh
- Trying to insert another label for a piechart in ChartsJS
- Using Chart.js onClick function, can you execute code from an undefined or null result?
- How to write better code in es6 for formatting an object with array values
- using ajax populate dynamic piechart from chartjs
- Piechart doesn't show up in Canvas
- 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
- ChartJS have xAxes labels match data source
- How to format tool tip as currency in piechart chartJS?
- Chart.js chart appears and disappears on form submit
- js devexpress PieChart Series color runtime
- how to populate my chartjs piechart dynamically
- Updating Chartjs to 2.5 with custom code
More Query from same tag
- ChartJS: Limit Y Axis to cut outlimit values
- Where is radar.js?
- ChartJS Separate Labels for each dataset/independent datasets?
- Adding labels and colours to Chart.JS from arrays
- Chart.js displays the label in a weird font in IE8
- Rotate left legend chartjs
- Use chartjs with rails
- Chart.js - Setting x-axis based on user input
- Chart js 2 bars with one customize label on top
- Uprading to chart.js@3.x with Angular 8
- Chart js sum of grouped bars
- How to set a locale for Chart.js date labels?
- Display two line graphs with data starting at different points
- Dynamically add x-axis in React using ChartJS
- Chart.js awkward label gaps before last x-axis label
- How to add space between datasets in ng2 doughnut chart
- Which Property do I need to edit, to change following Color?
- Is It Possible To Generate a ChartJS In C# Web API And Save Image?
- Angular-ChartJS align legend right center
- Passing json_encode to chart.js won't work
- Chart.js Undesired Tooltip Showing Up for Legend
- Specific grid line in X axis in ChartJs
- chart.js streaming data plugin data format or config error
- Why is this chartjs graph not being loaded? (Using Vue.js)
- Chart.js is not working on my Browser
- Chartjs unexpected resize and crop after updating data. Using laravel blade view and Livewire
- Adding additional data to chart
- How to add an extra legend item in chart.js?
- Angular 6 ChartJS create canvas dynamically and create graph on it - an example?
- Vertical Punchcard with chartjs