mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-11 05:24:25 +00:00
![]() The chart axis get initialized really, so changing the segmenter in initComponent is not possible anymore, we can only alter the chart base config in the constructor. Luckily, the actual segmentation happens later, so we can pass a flag to the y-axis and hook into the segmenter directly by creating a new one derived from 'Ext.chart.axis.segmenter.Numeric'. There we override the preferStep and exactStep methods to decide if we want to calculate with base 10 or base 2. So add a constructor to RRDChart and set the axis with the respective segmenter, depending on the powerOfTwo config, up there initially. Note: that makes overwriting the axes from a caller impossible, but we do not use that anywhere, and we can control the more important parts of the axes, like label or units already otherwise, so seems not really required, and if, its not to hard to solve (either by always using our new segmenter by default and handle the different bases there directly, or by adding an explicit do not touch axes config flag, or the like). Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> |
||
---|---|---|
debian | ||
src | ||
Makefile |