[lib] better handling for x axis values, save chart to a file (wip), code cleanup