You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "helgasoft (via GitHub)" <gi...@apache.org> on 2026/02/16 21:45:24 UTC

[I] violin chart - contours do not include negative values [echarts-custom-series]

helgasoft opened a new issue, #21:
URL: https://github.com/apache/echarts-custom-series/issues/21

   contours do not include negative values - [Demo](https://echarts.apache.org/examples/en/editor.html?code=lVXNjuM2DL7nKdQcJlai-GfaaQE73sF2BwUG6GIHSIE9BD4othJr4EiGJU-SZv3upSTbyewWBZpDZJE0-ZH8SAcBKrWuVRwEDT36e67Ldtsq1uRSaCa0n8tDQGualyxgeUkbrZZ5q7Q8LMGIMxU0bKeCktFCBQfKRfBe-8ZlBcKCK90_-7TV0j_Aw6ua6JIr38k_2ffW9rVnoTStKtaku1bkmkvh4csUYCGlG57raTLIkfAEvjRMt41An6kufbpVIFql0aP_28Pci5ZiLnAcdm-0QfrqTxOGL0bG00uX8J0n2qpKU5MwJH7SPSqFLz-I0k1G-I-WyU42nvFIQVdQTSELXrA_mdjrksg0TOSKJouFdHGrlPlvtGqZFxKJExeeb6rs7s4zR3rZ8UbpJ-uoYKdYEuM03mQdJsbAxvDrVpXe4CkCT7jrWAWV-jeE2ueaHV7ouZK08NX5sJXVmv_NEgOoIYq0pLjCwiQfLxEmb3DJpWwKb1OQPMNkBxFu_W2pKL7yQpfrnFaMlCng6l-ISJjhTZgtR0nYS_C8r_zuMYp3mNRQgyIj59RITV_qu7vaf1-K1PTJVRhursz4MpR_n3pNKohKI9KmtbUjY9uBLIOdTkPCoCts1fqVbVLCFgusF2njeWLZbliGA4WTnlw68Aa7ucLQg8P36QOHZSv0t29RGJKjYckJ3J9Wh-QEfo-uVSegZBh4h2WEMR4p85we_QOtPe8WqAu8EWQPN-g6JmvjdGv-Pt1OBlRp20P7EF0TFOkgXUaJ-ABYlkuBtw7H5n7-Zhqy3YgMTmLPKMuw5YIhz21utGH0C2wBrs_J2jm46HPN4mktq_NeiilRJYX7pZZcaBVvfVXxnHm4I0qfK1DseFXFQCeuWlp501
 xWspliIp3XuOf_o_8Q867D3QA9DTvyAtBfVs9DlxaLFzdCT7eMfN68mEQgAfsUZSs_DKPHTx4GMC7lJ9AvyuB-3luQJ5txBzZAuD6hfSPbekrykldFw0S8JopDYB3_FHZdz4Vz17PiAlNlNlV82zfhN2wPC481tzvNm7opnBINI9pByAks34-wDA9Uc5iY6oyG95AuGXKLFLlFOpm2wPUdF6yY_pQapHKHjlwU8nh3506_38_f333Ym14v-o9Vi5PJZAILQ2l0MpOGUrSZfZZiRtDsr5aZ4ysr7K1szfFHw82xptoerZhlSe_AzNxatk3OjJfN7ImejY1dJbMMzICiyKuYRhwMwgSOlYs69BgtFhyjywShq0c7XWAfhWjudj20ShSee4TlIw8eBtUDRgv0kMC7Y5hXF-YVwoyeTIxXFwMhxfcCbN67WqHQf0CPaBmhGEXG4QDHZgL29rU5chA0FR6ADtA9xP95xDh4W6B7qLHxcS1PT0yb-oZnxDkGDoNdN-kmE1nbr1xqYWopK83reMBcymOMdNMyYszN3-njiatBb_mMZjnVbC8b6MAYPHbFdoJXroFykCBsrRvBlzfWVBSC7Sh8TsYI5z6CvRhfiukRkM0pvslvfM2xOEYba-jMrwgtH3t8CKYAqN48w_oBnWPsqLNr4_czKMx6GsX9iI7FML-b_TUAtKbjVy9Gvwy2CN1suBja_utV8_6zBnXyH65KGOFh78foPuzlNuXx-C5bBQ2B-o7YmchlAYorxBMguIYAPNFw6z3-rzrcJtynZd1kZNIl_wA&enc=deflate)


-- 
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: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] violin chart - contours do not include negative values [echarts-custom-series]

Posted by "jacciz (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org