Magnitude as a position
This example shows a horizontal bar chart where each bar’s position along the x-axis encodes both the sign and magnitude of a numeric value: positive values extend to the right of a central zero line in blue, while negative values extend to the left in brown. The chart reads data from a tab-separated file and renders it using D3.js with SVG, applying a linear x-scale for magnitude, an ordinal y-scale for categorical names, and a top-oriented axis. Bar lengths are computed as the absolute difference between the value’s position and the zero position, and styling is handled via CSS classes. The axis line is drawn explicitly at the zero mark.
AI-generated descriptionI have taken a simple dataset which contains positive and negative value.This graph plots the positive values from dataset towards right side and negative values towards left side.All the positive values are represented in blue color and negative values are given red colors.
Channel used: Magnitude channel.(magnitude as position)
Marks : Bars.

The discriminability is maintained here as the common scale is used for representing the both type of values and magnitude of bar changes with change in position along the axis