By default, the scale of the x-axis is calculated from values, resulting in uneven distances between two adjacent points. For example, with an array of values like [1,2,5]
, there will be different distances on the x-axis for each point, and the x-axis labels may not align directly with the values (e.g., labels could show 1,2,3,4,5 instead of just 1,2,5). This can be especially problematic when displaying dates on the x-axis, leading to duplicate dates being displayed.
To see an example of this issue, check out this Plunker. When you maximize your browser window, you'll notice duplicate x-axis labels and inconsistent distances between points.
I'm looking to achieve the following:
- Prevent any duplicate x-axis labels from appearing.
- Ensure that the distance between points is equally distributed based on the graph's width, rather than scaled according to the values.