GSoC Update: Week 5 and Week 6(This)
Devansh Varshney
varshney.devansh614 at gmail.com
Mon Jun 17 10:38:20 UTC 2024
Hi,
So, the previous week I made the update regarding the chart bars not
looking like the Histogram and unable to get the X and Y axis to align with
the Bin and Frequency respectively.
This week, my mentor Tomaz asked me if there is any trouble I am
experiencing. I then asked him if I am unable to get the bars aligned with
how the Histogram bars seem visible. He immediately found my mistake, which
was a little typo -
[image: image.png]
with the small case of W for the word Width.
GapwidthSequence
and now the chart resembles what a histogram looks like -
[image: Screenshot from 2024-06-17 15-17-27.png]
But, still the conversion of X and Y axis to the Bin and Frequency I made
some changes' day before yesterday which I have stashed them(ATTACHED FILE)
as they first do not show the bars which was the main thing. Second, I
think these are not the right changes which we intend to need. So, I
reverted and stashed them.
What I am doing is now calculating the bins first, then aggregating data
points in bin.
Then drawing bars using modified doZSlot and doXSlot methods, maintaining
the original structure while adapting the logic for histogram requirements.
Which I did in the stash but feels like not properly.
Here's the link to the PR: https://gerrit.libreoffice.org/c/core/+/167068/
Devansh Varshney <varshney.devansh614 at gmail.com>
Fri, 14 Jun, 00:10 (3 days ago)
to libreoffice
Hi,
I didn't post the update for weeks 3 and 4 as I have been working on
eliminating the gaps between histogram bars that were visible in week 2 on
the UI. This is something I have been wrapping my head around. I was
tempted to get it done, but didn't realize it would take a while.
After discussing with my mentor Tomaz, He explained to me how the zSlot is
being used, and I made changes to the m_aZSlots variable. This variable is
crucial for managing the layering of different data series along the Z-axis
in our charting framework. However, since a histogram typically deals with
a single series of data to create a frequency distribution, we can simplify
this by always using the zero index of m_aZSlots.
void HistogramChart::adaptGapwidthForHistogram()
{
VDataSeries* pFirstSeries = getFirstSeries();
if (!pFirstSeries)
return;
sal_Int32 nAxisIndex = pFirstSeries->getAttachedAxisIndex();
sal_Int32 nUseThisIndex = nAxisIndex;
if (nUseThisIndex < 0 || nUseThisIndex >= m_aGapwidthSequence.getLength())
nUseThisIndex = 0;
auto aGapwidthSequenceRange = asNonConstRange(m_aGapwidthSequence);
for (sal_Int32 nN = 0; nN < m_aGapwidthSequence.getLength(); nN++)
{
aGapwidthSequenceRange[nN] = 0; // Set gap width to 0
}
}
This is what I tried to add for the Gap based on the logic present in the
BarChart.cxx
Now, what he also helped me to understand what I should be focusing on
first is to figure out the way how the X and Y axis can be changed to mimic
the Bins and Frequency. Which I am working on.
So, for these 2 weeks, I am thinking a way to make the X and Y axis working
for the Histogram.
Devansh Varshney <varshney.devansh614 at gmail.com>
Thu, 23 May, 20:10
For this week, the columns/bars are now visible over the UI. I still have
to make proper changes to the model and controller. Now I need to make
changes to modify these changes eventually towards getting the Histogram
plot.
Here's the link to the PR: https://gerrit.libreoffice.org/c/core/+/167068/
--
*Regards,*
*Devansh*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20240617/f1cd8885/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 67075 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20240617/f1cd8885/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2024-06-17 15-17-27.png
Type: image/png
Size: 25995 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20240617/f1cd8885/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binfreq.cc
Type: text/x-c-code
Size: 35321 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20240617/f1cd8885/attachment.bin>
More information about the LibreOffice
mailing list