8000 Bar chart support by lovromazgon · Pull Request #323 · shenwei356/csvtk · GitHub
[go: up one dir, main page]

Skip to content

Bar chart support #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 5, 2025
Merged

Bar chart support #323

merged 3 commits into from
May 5, 2025

Conversation

lovromazgon
Copy link
Contributor
@lovromazgon lovromazgon commented Apr 25, 2025

I noticed that it was originally planned to support bar charts, but that feature wasn't implemented. I added the command csvtk plot bar that allows you to output a bar chart.

The PR is still missing documentation and examples. I was testing it with my own data, and it almost works as expected. I need to make sure labels and legend are set correctly and aligned to the bars in all scenarios (e.g. grouped data).

I wanted to first open the PR to see if this is something you'd be willing to include in csvtk so to know if it's worth finalizing the code and documentation.

For instance, running this:

cat testdata/date2value.csv \
    | csvtk gather -f 2- -k type -v count \
    | csvtk plot bar --group-field type -x date -y count --legend-top \
    > bar-chart.png

Creates this graph:
graph

Let me know what you think 🙂

@shenwei356
Copy link
Owner

I wanted to first open the PR to see if this is something you'd be willing to include in csvtk so to know if it's worth finalizing the code and documentation.

Looks great! Thanks!

@shenwei356 shenwei356 merged commit e9bc089 into shenwei356:master May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0