jacciz commented on issue #21:
URL:
https://github.com/apache/echarts-custom-series/issues/21#issuecomment-3977400166
Developers - I believe the issue is that this line in violin.js has 10 as
hard-coded:
`xRange.push(i * (10 / (binCount - 1)));`
Replacing that part of code with this worked for me:
```
var dataMin = Math.min.apply(null, violin.data);
var dataMax = Math.max.apply(null, violin.data);
var padding = (dataMax - dataMin) * 0.2 || 1; // 20% padding, fallback if
flat
var rangeMin = dataMin - padding;
var rangeMax = dataMax + padding;
for (var i = 0; i < binCount; i++) {
xRange.push(rangeMin + i * ((rangeMax - rangeMin) / (binCount - 1)));
}
````
<img width="410" height="455" alt="Image"
src="https://github.com/user-attachments/assets/98d66fc1-0ad8-40b7-a375-274eaec3c831"
/>
I'm using {echart4r} so am not too familiar with js code.
--
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]