Combined stack bar chart plus 2 lines and 2 y-axis, not rendered correctly

Expected Behavior

I hesitate to raise this as a bug report since I’m not entirely sure that I have configured the options correctly or if Chart.js supports this scenario (2 unstacked lines superimposed on a stacked bar chart). But I have an issue with a stacked bar chart that includes 2 lines with each line being represented by a different y-axis. The y-axis does not show the correct values for the data points provided. The data provided ranges from 5000 – 0 and the associated right y-axis renders -1.0 – 1.0.

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. See linked CodePen example below.
  2. Notice points for line “d” are wrong relative to the left y-axis as well. However, if the user removes line “c” then line “d” displays correctly relative to the left axis though it is assigned to the right axis.

Context

I’m trying to have a stacked bar chart with 2 unstacked lines – preferably with one left y-axis only, since all data points fall within the same range.

Environment

Other details:

combined-stacked-bar-chart-and-2-unstacked-lines SO question with linked jsfiddle demonstrating the problem.

Author: Fantashit

1 thought on “Combined stack bar chart plus 2 lines and 2 y-axis, not rendered correctly

Comments are closed.