Skip to content

resolve "Support height parameter in figures.cc charts"

Solution

I went for option 1.1 (see issue description), as it was the simplest. Maybe at some point in the future we need to make use of resize for whatever reason, but we can fix that if and when we need it.

Note that this change doesn't effect the boolean charts, as they use their own aspect ratios, as the data is somewhat shallow. I think this is fine though, as we probably want this aspect ratio as well in the PDFs

Testing

Currently this parameter isn't used anywhere, but, if you want to test it, you can manually add in the height parameter in complex-data-view-widgets.commons.ts > getChartDimensions, e.g.

export function getChartDimensions(dataViewControl?: DataViewControl, width: number = 400, height?: number): BaseChartConfig<ConsumableDataBase>['dimensions']{
	return {
				// height,
				height: 800,
				width,
				margin: {
					top: 0,
					right: 0,
					bottom: Math.max(width*0.05, 32),
					left: Math.max(width*0.2, 54),
				},
			}
}

Unit tests

I didn't add any, as this isn't our code, and is only a minor adjustment

Closes #1016

Merge request reports

Loading