Skuperday commented on issue #17858:
URL: https://github.com/apache/echarts/issues/17858#issuecomment-1397902071

   Hello there! I ran into a same trouble a couple of days ago and found a 
solution how to use a bar chart and line chart so that the filtering does not 
cut off the data. This solved my problem with dataZoom
   All that is needed is to change the weakFilter behavior logic in the 
sources. For a line chart, using filters causes problems when 1-2 points 
remain, but @cfwang123 was able to find a solution to the problem of filter 
behavior, I suggest using the old filter for the bar chart, and in all other 
situations, the modified filter @cfwang123
   from:
   `var thisLeftOut = value < valueWindow[0];`
    `var thisRightOut = value > valueWindow[1]; `
   to:
   `if(seriesModel.subType === 'bar') {`
   `    var thisLeftOut = value < valueWindow[0];`
   `    var thisRightOut = value > valueWindow[1];`
   `} else {`
   `    var thisLeftOut = value < valueWindow[0] && seriesData.get(dataDims[i], 
dataIndex+1) < valueWindow[0];`
   `    var thisRightOut = value > valueWindow[1] && 
seriesData.get(dataDims[i], dataIndex-1) > valueWindow[1];`
   `}`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to