Bug 82716 - Ability to create histogram chart directly from data, not using FREQUENCY()
Summary: Ability to create histogram chart directly from data, not using FREQUENCY()
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Devansh Varshney
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: Additional-Chart-Types Histogram-Chart
  Show dependency treegraph
 
Reported: 2014-08-17 00:00 UTC by 7qia0tp02
Modified: 2024-09-22 12:08 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Patch 42 of Histogram Chart (60.56 KB, image/png)
2024-07-14 08:39 UTC, Devansh Varshney
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 7qia0tp02 2014-08-17 00:00:58 UTC
We should be able to create histograms of a column of data just by selecting that column and creating a chart.  The bin number and log/linear spacing of bins, etc can be set in the plot options window.  Currently it's possible to make histograms using the FREQUENCY() command, but it requires extra plot-only things being added to the spreadsheet.
Comment 1 Jean-Baptiste Faure 2014-08-18 04:26:16 UTC
Please, could you elaborate a bit? I use histogram charts and I never used FREQUENCY() command.

Set status to NEEDINFO. Please set it back to UNCONFIRMED once you have provided requested informations. Thank you for your understanding.

Best regards. JBF
Comment 2 7qia0tp02 2014-08-18 15:16:32 UTC
Can you please describe how to do it without FREQUENCY() command?

For example, if data is 

1
2
3
11
12
13
45

and the bins are 0-10, 11-20, 21-30, etc, then the histogram would have a height of 

 0-10: 3
11-20: 3
21-30: 0
31-40: 0
41-50: 1
51-60: 0

https://en.wikipedia.org/wiki/Histogram

http://ask.libreoffice.org/en/question/17/how-do-you-plot-a-histogram-in-libreoffice-calc/?answer=10011#post-id-10011

http://ask.libreoffice.org/en/question/19816/

https://bugs.freedesktop.org/show_bug.cgi?id=81530
Comment 3 Jean-Baptiste Faure 2014-08-18 19:29:55 UTC
Ok, with complete information it is easier to understand what you mean. For many users who are not statisticians histogram could be understand as bar chart.
Valid enhancement request.

Best regards. JBF
Comment 4 Stanislav Horacek 2015-02-24 07:21:28 UTC

*** This bug has been marked as a duplicate of bug 74665 ***
Comment 5 Jean-Baptiste Faure 2015-02-24 21:17:57 UTC
Changed source and target: this enhancement explain what is expected, while bug 74665 is very cryptic.

Best regards. JBF
Comment 6 Jean-Baptiste Faure 2015-02-24 21:18:49 UTC
*** Bug 74665 has been marked as a duplicate of this bug. ***
Comment 7 David Root 2020-01-15 17:18:04 UTC Comment hidden (spam)
Comment 8 David Root 2020-01-15 17:19:32 UTC Comment hidden (spam)
Comment 9 David Root 2020-01-22 16:56:13 UTC Comment hidden (spam)
Comment 10 7qia0tp02 2023-03-10 20:45:04 UTC
For comparison, Google Sheets allows you to highlight a single column of data, click Insert -> Chart, and it creates a Histogram immediately, by default.  You can then change the "bucket size" in the chart options, etc.

(It doesn't allow you to specify differently-sized "buckets" though, as desired in bug 81530.)
Comment 11 Stéphane Guillou (stragu) 2024-07-11 01:44:08 UTC
Please also see bug 74665's attachment 192673 [details] for inspiration from Gnumeric's dialog.

Devansh is currently working on this as part of GSoC, see work in progress on gerrit: https://gerrit.libreoffice.org/c/core/+/167068

Devansh, you can mark this report as "assigned" and add yourself to the "Assignee" field.
Comment 12 Stéphane Guillou (stragu) 2024-07-11 01:45:52 UTC
(In reply to Stéphane Guillou (stragu) from comment #11)
> Please also see bug 74665's attachment 192673 [details] for inspiration from
> Gnumeric's dialog.
See bug 74665 comment 16 for more details, and I recommend installing Gnumeric and testing it first hand.
Comment 13 Devansh Varshney 2024-07-14 08:39:10 UTC
Created attachment 195283 [details]
Patch 42 of Histogram Chart

This is what we are able to have for the histogram chart, as can be seen in the screenshot.

The bars seem to be much wider, which will be updated in an upcoming patch if needed.

As of now, we are using the sqrt method to calculate the number of Bins -

void HistogramChartType::computeBinFrequencyHistogram(const std::vector<double>& dataPoints)
{ 
   //...code

     m_nBins = static_cast<sal_Int32>(std::sqrt(dataPoints.size()));

   //...code
}
Comment 14 Commit Notification 2024-07-21 06:02:59 UTC
varshneydevansh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/07ae0e5ada7cb595eb4815413a5bdd442c32a6ab

tdf#82716 Add initial implementation of the Histogram Chart

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Stéphane Guillou (stragu) 2024-07-22 01:43:17 UTC
I have opened the meta bug 162134 to track follow-up enhancements and bugs. Maybe this can be closed as "fixed" then, if you agree, Devansh and Quikee?
Thanks for the initial implementation!
Comment 16 Devansh Varshney 2024-07-22 19:07:53 UTC
(In reply to Stéphane Guillou (stragu) from comment #15)
> I have opened the meta bug 162134 to track follow-up enhancements and bugs.
> Maybe this can be closed as "fixed" then, if you agree, Devansh and Quikee?
> Thanks for the initial implementation!

Okay I am looking in the META bug tracker.
Comment 17 Commit Notification 2024-08-04 09:01:32 UTC
varshneydevansh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aebe61498bd226b2392cdfcfe5ad7db4489bd48e

tdf#82716 Implement Correct Calculation for Histogram Chart

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Mike Kaganski 2024-09-22 12:08:47 UTC
Please add  to the release notes.