<div dir="ltr"><div class="gmail_default" style="font-family:comic sans ms,sans-serif">So for this week I have been able to align the Bin and Frequency calculation for the Histogram correct.</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">Since, past week it was getting often garbage values or sometime not properly retaining calculated values.</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">Example screenshot of some miscalculations -<br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><img src="cid:ii_lxw25x430" alt="image.png" width="385" height="189" style="margin-right:0px"><br><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"> <img src="cid:ii_lxw26pwg1" alt="image.png" width="186" height="234" style="margin-right:0px">                  <img src="cid:ii_lxw26xmi2" alt="image.png" width="181" height="229" style="margin-right:0px"><br><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">After adjusting the <br><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(86,156,214)">void</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(78,201,176)">HistogramChartType</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">computeBinFrequencyHistogram</span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(86,156,214)">const</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(78,201,176)">vector</span><span style="color:rgb(204,204,204)"><</span><span style="color:rgb(86,156,214)">double</span><span style="color:rgb(204,204,204)">></span><span style="color:rgb(86,156,214)">&</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(156,220,254)">dataPoints</span><span style="color:rgb(204,204,204)">)</span></div></div></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">the variables and calculations are safe.</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">for example like this -</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(106,153,85)">    //round min and max to 6 decimal places</span></div><div><span style="color:rgb(204,204,204)">    minValue </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">round</span><span style="color:rgb(204,204,204)">(minValue </span><span style="color:rgb(212,212,212)">*</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">) </span><span style="color:rgb(212,212,212)">/</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">;</span></div><div><span style="color:rgb(204,204,204)">    maxValue </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">round</span><span style="color:rgb(204,204,204)">(maxValue </span><span style="color:rgb(212,212,212)">*</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">) </span><span style="color:rgb(212,212,212)">/</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">;</span></div><br><div><span style="color:rgb(106,153,85)">    // Handle the case where all values are the same</span></div><div><span style="color:rgb(204,204,204)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(204,204,204)"> (minValue </span><span style="color:rgb(212,212,212)">==</span><span style="color:rgb(204,204,204)"> maxValue)</span></div><div><span style="color:rgb(204,204,204)">    {</span></div><div><span style="color:rgb(204,204,204)">        m_nBins </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(204,204,204)">;</span></div><div><span style="color:rgb(204,204,204)">        m_fBinWidth </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1.0</span><span style="color:rgb(204,204,204)">;</span></div><div><span style="color:rgb(204,204,204)">        m_binRanges </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> { { minValue, minValue </span><span style="color:rgb(212,212,212)">+</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1.0</span><span style="color:rgb(204,204,204)"> } };</span></div><div><span style="color:rgb(204,204,204)">        m_binFrequencies </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> { </span><span style="color:rgb(86,156,214)">static_cast</span><span style="color:rgb(212,212,212)"><</span><span style="color:rgb(204,204,204)">sal_Int32</span><span style="color:rgb(212,212,212)">></span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(156,220,254)">dataPoints</span><span style="color:rgb(204,204,204)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(204,204,204)">()) };</span></div><div><span style="color:rgb(204,204,204)">        </span><span style="color:rgb(197,134,192)">return</span><span style="color:rgb(204,204,204)">;</span></div><div><span style="color:rgb(204,204,204)">    }</span></div><br><div><span style="color:rgb(204,204,204)">    m_nBins </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">static_cast</span><span style="color:rgb(212,212,212)"><</span><span style="color:rgb(204,204,204)">sal_Int32</span><span style="color:rgb(212,212,212)">></span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">sqrt</span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(156,220,254)">dataPoints</span><span style="color:rgb(204,204,204)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(204,204,204)">()));</span></div><br><div><span style="color:rgb(106,153,85)">    //calculate bin width, ensuring it's not zero and rounding to 6 decimal places</span></div><div><span style="color:rgb(204,204,204)">    m_fBinWidth </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">round</span><span style="color:rgb(204,204,204)">((maxValue </span><span style="color:rgb(212,212,212)">-</span><span style="color:rgb(204,204,204)"> minValue) </span><span style="color:rgb(212,212,212)">/</span><span style="color:rgb(204,204,204)"> m_nBins </span><span style="color:rgb(212,212,212)">*</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">) </span><span style="color:rgb(212,212,212)">/</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">1e6</span><span style="color:rgb(204,204,204)">;</span></div><div><span style="color:rgb(204,204,204)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(204,204,204)"> (m_fBinWidth </span><span style="color:rgb(212,212,212)"><=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">0</span><span style="color:rgb(204,204,204)">)</span></div><div><span style="color:rgb(204,204,204)">    {</span></div><div><span style="color:rgb(204,204,204)">        m_fBinWidth </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(181,206,168)">0.000001</span><span style="color:rgb(204,204,204)">;</span><span style="color:rgb(106,153,85)"> // Minimum bin width of 0.000001</span></div><div><span style="color:rgb(204,204,204)">        m_nBins </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">static_cast</span><span style="color:rgb(212,212,212)"><</span><span style="color:rgb(204,204,204)">sal_Int32</span><span style="color:rgb(212,212,212)">></span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">ceil</span><span style="color:rgb(204,204,204)">((maxValue </span><span style="color:rgb(212,212,212)">-</span><span style="color:rgb(204,204,204)"> minValue) </span><span style="color:rgb(212,212,212)">/</span><span style="color:rgb(204,204,204)"> m_fBinWidth));</span></div><div><span style="color:rgb(204,204,204)">    }</span></div></div></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">Currently, I am calculating the Bins with the square root method (there are more ways to do this) -<br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(204,204,204)">m_nBins </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">static_cast</span><span style="color:rgb(212,212,212)"><</span><span style="color:rgb(204,204,204)">sal_Int32</span><span style="color:rgb(212,212,212)">></span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(78,201,176)">std</span><span style="color:rgb(204,204,204)">::</span><span style="color:rgb(220,220,170)">sqrt</span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(156,220,254)">dataPoints</span><span style="color:rgb(204,204,204)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(204,204,204)">()));</span></div></div></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><span style="background-color:rgb(244,204,204)">terminal output while LO development is running and selecting the Histogram Chart from the UI</span> -</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">```bash<br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"> [~/libreoffice]<br> devansh   histogram_support -+  instdir/program/scalc                                                         [24/06/26| 10:09PM]<br>warn:vcl.schedule:173007:173007:vcl/source/app/scheduler.cxx:639: Stop the task before changing the priority, as it will just change after the task was scheduled with the old prio!<br>warn:chart2:173007:173007:chart2/source/controller/main/ControllerCommandDispatch.cxx:723: commandAvailable: command not in availability map:.uno:StatusBarVisible<br>warn:chart2:173007:173007:chart2/source/controller/main/ControllerCommandDispatch.cxx:723: commandAvailable: command not in availability map:.uno:StatusBarVisible<br>warn:chart2:173007:173007:chart2/source/controller/main/ControllerCommandDispatch.cxx:723: commandAvailable: command not in availability map:.uno:StatusBarVisible<br><span style="background-color:rgb(208,224,227)">m_nBins: 2, m_fBinWidth: 3<br>minValue: 10, maxValue: 16<br>m_binRanges: {10, 13} {13, 16} <br>m_binFrequencies: 3 2 </span></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">```<br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">As you can see the calculations are seem to be correct, while to make sure these changes for the <span style="background-color:rgb(217,234,211);color:rgb(0,0,0)"></span><span style="background-color:rgb(217,234,211);color:rgb(0,0,0)">computeBinFrequencyHistogram</span><span style="background-color:rgb(217,234,211);color:rgb(0,0,0)"></span> I got stuck with some R-B tree related error for the debugger in the VS Code. But, it got sorted out, all I did was a couple of restarts and adding the new patches from the master. ;) </div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">But, the elephant in the room the <b>X and Y axis conversion</b> to the <b>bin</b> and <b>frequency</b> is still not complete. I have cluttered a lot of code from the <b><span style="color:rgb(11,83,148)">doZSlot</span></b> and <b><span style="color:rgb(53,28,117)">doXSlot</span></b> which was related to the 3D and specifically to the Bars/Columns and made changes to the logic to adapt for the processing of the bins and frequency, but still seems like it needs more careful considerations.<br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif">But, over the UI the bars are now NOT being drawn, so I am looking into this.</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><a href="https://gerrit.libreoffice.org/c/core/+/167068" target="_blank">https://gerrit.libreoffice.org/c/core/+/167068</a></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-family:monospace"><b>Regards,</b></span></div><div><span style="font-family:monospace;color:rgb(153,0,255)"><b>Devansh</b></span><br></div></div></div></div>