-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to display missing data in a chart? #633
Comments
I tried tweaking the data-labels and you can try changing the plotOptions: {
bar: {
horizontal: true,
dataLabels: {
position: 'top'
}
}
},
dataLabels: {
enabled: true,
textAnchor: 'start',
offsetX: 20,
style: {
fontSize: '12px',
colors: ['#333']
},
formatter: function (val, {
ctx,
seriesIndex,
dataPointIndex,
w
}) {
if(val === null) {
return ' NO DATA'
} else {
return val
}
}
} I had to make some changes to the code to make the above code render null values in data-labels. |
@Khanh-Ngy I tested the code and it works fine. Can you check what is in the |
|
Ok, then I will have to see a full codepen/codesandbox. Can you please create one? |
I meant - a minimal reproducible example :) |
Oh ! Sorry . This is my final chart ^^ |
i need this but with grouped bars, any way to do?? |
Hi, my solution was that you can create fake data and use CSS for hiding these fake data |
Is there a recommended way to display a "no data" datapoint in a chart? Currently, if an entry in the series data array is null or an empty object/array, the graph will simply display it as equal to zero.
It would be confusing or misleading to omit the missing year in the axes, and in my opinion, equally misleading to simply mark it as 0.
This is different than the "No Data" property in Options, as it is not the entire graph that is missing data. (unless I am missing something here!)
So for example, let's say that you have a chart that displays some data from 2014-2018, however you are missing data for 2017.
Is it possible to manipulate the graph to output something like this:
If not, what is the recommended course of action in this case?
Thank you!!
The text was updated successfully, but these errors were encountered: