43ebc9fee33b23d8ac12a77441a5e2140c0bcb0b kent Wed Jan 20 09:15:44 2021 -0800 Adjusting padding and barWidth when have lots of bars. diff --git src/hg/hgTracks/barChartTrack.c src/hg/hgTracks/barChartTrack.c index e185d8c..e9bca0b 100644 --- src/hg/hgTracks/barChartTrack.c +++ src/hg/hgTracks/barChartTrack.c @@ -403,30 +403,37 @@ else if (winSize < extras->winMedGraph && differentString(extras->maxGraphSize, BAR_CHART_MAX_GRAPH_SIZE_SMALL)) { extras->boxModelHeight = MED_BAR_CHART_MODEL_HEIGHT; extras->barWidth = MED_BAR_WIDTH * scale; extras->padding = MED_GRAPH_PADDING; extras->maxHeight = MED_GRAPH_HEIGHT; } else { extras->boxModelHeight = MIN_BAR_CHART_MODEL_HEIGHT; extras->barWidth = MIN_BAR_WIDTH * scale; extras->padding = MIN_GRAPH_PADDING; extras->maxHeight = tl.fontHeight * 4; } +if (extras->barWidth <= 2) + { + if (extras->padding > 1) + extras->padding = 1; + extras->barWidth = 2; + } + extras->modelHeight = extras->boxModelHeight + 3; extras->margin = 1; extras->squishHeight = tl.fontHeight - tl.fontHeight/2; /* Get bed (names and all-sample category median scores) in range */ loadSimpleBedWithLoader(tg, (bedItemLoader)barChartSimpleBedLoad); /* Create itemInfo items with BED and geneModels */ struct barChartItem *itemInfo = NULL, *list = NULL; struct bed *bed = (struct bed *)tg->items; /* Test that configuration matches data file */ if (bed != NULL) { int categCount = getCategoryCount(tg);