7a66ec026712b92017d2bf9d2e313ad079eea28f kent Tue Dec 22 11:04:39 2020 -0800 Fine tuning some layout constants. diff --git src/hg/hgc/barChartClick.c src/hg/hgc/barChartClick.c index c189a9f..7deb0d0 100644 --- src/hg/hgc/barChartClick.c +++ src/hg/hgc/barChartClick.c @@ -372,51 +372,51 @@ warn("Error creating boxplot from sample data with command: %s", cmd->string); } static double longestLabelSize(struct barChartCategory *categList) /* Get estimate of longest label in pixels */ { MgFont *font = mgHelvetica14Font(); int longest = 0; struct barChartCategory *categ; for (categ = categList; categ != NULL; categ = categ->next) { int size = mgFontStringWidth(font, categ->label); if (size > longest) longest = size; } -return longest * 1.1; +return longest * 1.09; } static void printBarChart(struct barChartBed *chart, struct trackDb *tdb, double maxVal) /* Plot bar chart without quartiles or anything fancy just using SVG */ { /* Load up input labels, color, and data */ struct barChartCategory *categs = barChartUiGetCategories(database, tdb); int categCount = slCount(categs); if (categCount != chart->expCount) { warn("Problem in %s barchart track. There are %d categories in trackDb and %d in data", tdb->track, categCount, chart->expCount); return; } double heightPer=18.0; double innerHeight=heightPer-1; double widthPer=1250.0; -double labelWidth = longestLabelSize(categs) + 2; +double labelWidth = longestLabelSize(categs) + 10; if (labelWidth > widthPer/2) labelWidth = widthPer/2; double labelOffset = 20.0; double barOffset = labelOffset + labelWidth; double barMaxWidth = widthPer-barOffset - 45; double totalHeight = heightPer * categCount; printf("<svg width=\"%g\" height=\"%g\">\n", widthPer, totalHeight); double yPos = 0.0; int i; struct barChartCategory *categ; printf("<clipPath id=\"labelClip\"><rect x=\"%g\" y=\"0\" width=\"%g\" height=\"%g\"/></clipPath>", labelOffset, barOffset-labelOffset, totalHeight); for (i=0, categ=categs; i<categCount; ++i , categ=categ->next, yPos += heightPer) {