Prevent clipping of column names when exporting diagram
This is my workflow.
1) Right click on a mysql database in the database explorer and choose Diagrams -> Show Diagram...
2) Click the Export Diagram button in the toolbar -> Export to image and choose png.
The image exports but tables with longer column names always end up with the text clipped. The text is not clipped when viewing the diagram in DataGrip, but it is always clipped when viewing the exported png.
I thought I may get around this by exporting the image as an svg, but doing this always results in nothing more than an empty svg file. DataGrip creates a file, but it is an svg file with no contents.
How can I export Diagrams to image without having the table's column name text clipped?
Below is an example of how a particular table looks when viewing it in DataGrip (1st photo) vs viewing it in an exported png (2nd photo).


Please sign in to leave a comment.
Hi Ap,
There's an issue with diagram export to SVG format reported here:
https://youtrack.jetbrains.com/issue/DBE-17864
As for the export to image formats, we couldn't reproduce this behavior where a single letter is clipped while the diagram is in full size (referring to your screenshots). What's your current DataGrip version?
Thank you for looking into it. Here's my version and system info (which I should have included in the first place). I do have the experimental UI enabled, but I tried and had the same results with it disabled too.
DataGrip 2023.1.1
Build #DB-231.8770.3, built on April 11, 2023
Licensed to Accounts Payable
Subscription is active until September 7, 2023.
Runtime version: 17.0.6+10-b829.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.2.0-20-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Registry:
editor.focus.mode.color.light=6a737d
ide.editor.tab.selection.animation=true
debugger.new.tool.window.layout=true
ide.new.editor.tabs.vertical.borders=true
ide.experimental.ui=true
ide.balloon.shadow.size=0
editor.focus.mode.color.dark=6a737d
Non-Bundled Plugins:
com.4lex4.intellij.solarized (2.4.0)
IdeaVIM (2.2.0)
com.mallowigi (90.0.0)
com.chrisrm.idea.MaterialThemeUI (8.6.3)
Current Desktop: ubuntu:GNOME
This is interesting as I'm also running an Ubuntu 21.05 with DataGrip 2023.1.1 on it, and I do not observe this behavior with the diagram export.
Can I ask you to take a screenshot of the whole diagram window in DataGrip and also, attach an exported file with a graphical extension? This is to cross-check things.
Sure, here's a screenshot of the entire window with a diagram open, and a png of the same diagram exported from DataGrip. The text is clipped in the diagram viewer inside DataGrip at some zoom levels too. This isn't really a problem though, because I can zoom in/out to make it not clipped. And below this I included a png of this diagram exported. I've also tried exporting to jpg, and gif, but the clipped text persists. Also tried disabling all installed plugins, including theme and icon plugins, and this didn't make a difference either. Thanks again for looking!
A .png export of the above diagram
Bumping this
This behavior doesn't get reproduced even on machines with the same environment.
Can you upgrade to 2023.1.2 version and see if this issue is present there?
insane year later and it still doesnt work, nice :)))))))))))) identical issues
This issue is still prevalent. I am running windows 11 with the current latest version of datagrips.
As you can see in the attached SC, letters and words are clearly clipped off.
The image is a database diagram export of type .png
Hi,
I tested the diagram export in DataGrip 2025.1.3 and was trying to minimize the table width in the diagram window, but it doesn't seem to allow doing that, taking into account the max length of the column. The same goes for the png export. Please specify your current IDE version and provide the table DDL
I have the same issue. Here is my IDE and OS info:
Hi Karolina Bozkova,
I see from this thread that the issue has been present for quite some time, but we still haven’t been able to reproduce this exact behavior, which is preventing us from investigating and fixing it. Could you please share a few additional details to help us narrow it down?
Lastly, it would be helpful if you could share the exact DDL for the affected table or tables. I could not reproduce the issue by recreating a structure similar to the one shown in the screenshots above, but the screenshots do not contain the full definition, so potentially important details may be missing.
Hi Anastasia Zhukova
ad 1) The diagram in DataGrip looks correct. Sometimes I have to play with zoom/fit, sometimes not. I even manually resized the table boxes so there is ample space for all the information and column names, but that does not help. The column names are cut off when exporting them to all the image formats: PNG, SVG, SVGZ, GIF, JPG. My settings of the top toolbar: options Key columns, Columns, Virtual foreign keys and Comments are ON. On smaller diagrams, I clicked the "1:1" button; on bigger ones, I clicked the "Fit Content" button to make sure everything is visible in case it influences anything.
ad 2) It occurs regardless of schema size - it affects both large and small schemas. On small schemas that don't have long column names it's just less visible (like part of the last letter is cut off) but it still occurs.
I don't have a single-table schema but I do have some small schemas like 3 tables of 3 columns each, or 2 tables where one has 3 columns and another has 6.
ad 3) Yes. Even on diagrams that look correct right away.
ad 4) MySQL
Honestly, it was really easy for me to recreate the bug - I spun up a amd64/mysql:5.6.51 database in docker compose, added a table with some columns, added it to Intellij as a MySQL data source, and it keeps on happening when I generate the diagram via right click on the db → Diagrams → Show diagram. Granted, the table shows up with column names cut off even in IntelliJ, I have to zoom out/stretch the table to fix it.
Exported PNG without any changes:
Fixed diagram in DataGrip (zoomed out, stretched table):
Exported PNG:
Here is the DDL (too bad I cannot attach it as a file, it's a bit long):