Added support for an offset value for the bar, and for setting and querying by value (which includes offset) in addition to index