-
Hiya, I'm trying to created a stacked line chart on which we need one of the lines to not be stacked but be plotted on the same scale as the ones that are. In my particular example we have three stacked lines, one for each quality of an item produced, and the stack of these three lines show the sum of all the items produced for each day, as shown below. This looks great, the problem i now have is that i would like to add a production target line to this chart so that i can see whether the sum of the items (regardless of quality) for a day reaches the target for that day. The problem that i have is that when i add a dataset for this target line it will obviously be included in the stack, as shown below. In the above example, every data value in the target dataset is 50, and this is just being added to my sum of items produced when i just want a flat line at y: 50. I know the reason why this is happening, so my first attempt at a workaround was to simply plot the target line against a second hidden non-stacked Y axis. This solves the problem of excluding the target line from the stack, but now my target line isn't using the same scale as the other three lines, as shown below. So my last solution, and one i'm not too happy with, was to explicitly set the same min and max value for both of these Y axis so that the scale would match. The result of this can be seen below. While this chart looks like exactly what i want, I don't like this approach. The min and max will always have to be derived from the actual data we are plotting. Can anyone suggest an alternative where i can achieve this result and have all four of these datasets sharing a scale, with my target not being stacked, but not have to jump through hoops in order to calculate a sensible min/max every time? You can find the example here: https://jsfiddle.net/L0h425u1/1/ Thanks very much :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you should be able to put it on a different stack. Eg, stack: alone in the dataset. |
Beta Was this translation helpful? Give feedback.
I think you should be able to put it on a different stack. Eg, stack: alone in the dataset.