Skip to content
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

Remove unnecessary checks for hidden data #6255

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/scales/scale.linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = LinearScaleBase.extend({
if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
helpers.each(dataset.data, function(rawValue, index) {
var value = +me.getRightValue(rawValue);
if (isNaN(value) || meta.data[index].hidden) {
if (isNaN(value)) {
return;
}

Expand Down Expand Up @@ -101,9 +101,9 @@ module.exports = LinearScaleBase.extend({
helpers.each(datasets, function(dataset, datasetIndex) {
var meta = chart.getDatasetMeta(datasetIndex);
if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
helpers.each(dataset.data, function(rawValue, index) {
helpers.each(dataset.data, function(rawValue) {
var value = +me.getRightValue(rawValue);
if (isNaN(value) || meta.data[index].hidden) {
if (isNaN(value)) {
return;
}

Expand Down
10 changes: 5 additions & 5 deletions src/scales/scale.logarithmic.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ module.exports = Scale.extend({
helpers.each(dataset.data, function(rawValue, index) {
var values = valuesPerStack[key];
var value = +me.getRightValue(rawValue);
// invalid, hidden and negative values are ignored
if (isNaN(value) || meta.data[index].hidden || value < 0) {
// invalid values are ignored
if (isNaN(value) || value < 0) {
return;
}
values[index] = values[index] || 0;
Expand All @@ -142,10 +142,10 @@ module.exports = Scale.extend({
helpers.each(datasets, function(dataset, datasetIndex) {
var meta = chart.getDatasetMeta(datasetIndex);
if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
helpers.each(dataset.data, function(rawValue, index) {
helpers.each(dataset.data, function(rawValue) {
var value = +me.getRightValue(rawValue);
// invalid, hidden and negative values are ignored
if (isNaN(value) || meta.data[index].hidden || value < 0) {
// invalid values are ignored
if (isNaN(value) || value < 0) {
return;
}

Expand Down