How to create a combination chart with the Charts module if some X-axis values are missing? I've been searching for a solution to my problem for a while without success so maybe someone here can help me.

I've already looked at the answer to the question about "How to combine 3 line charts in a single chart, using the Views integration of the Charts module?", but that didn't help to solve my issue.

I use the Charts module to create a chart in Views using the "Chart" display format. And I'm using Highcharts as my charting library to draw the number of "Passed" nodes (in green). I also created a chart add-on to represent the number of "Failed" nodes (in red) so that I can have multiple series in the same chart.

At this moment this is the chart that I have with the problem I will describe below:



As you can see in the table above, I have 4 different dates (Run Date and Time). The chart should show the 4 dates. Instead, it only shows 3 dates and this is why: The last date doesn't have "Passed" nodes, so the chart display (the parent) does not have that value on its axis. The chart add-on, representing the 2 Faileds on the last date, is then represented on top of the first display using the 3rd date and not the 4th, giving the error.

It seems that the x-axis values are irrelevant in this module.

The chart that I want should be something like this:



I made this chart in Excel and the difference that I see (that is giving me the wrong results in Drupal) is that I don't have a "0 Passed" or "0 Failed" but instead I have no results at all.

Is there a way to get this working correctly? I tried already many charts modules available and everyone has this problem as far as I know ...

Below is also a screenprint of my view:



Note: for the table below the chart I'm using module Views Merge Rows and it's clear that the top two dates don't show the "0 Failed" or "0 Passed" (as shown in the tabular display of my first screenprint) needed to have a correct chart displayed.

EDIT: I have found the same issue here and here. Hope it helps.

If there's need to have a solution like in the second link, i.e., construct the view in a way that both series will always have all labels, I'm open to it.
Step 1

Not sure if it's your "only" problem to get your chart right, but part of your problem is, pretty sure, that you have "holes" in your data, similar to what is detailed in Comment nr 12 of Issue nr 2052429.

About the problem

To understand what that issue about "hole" is all about, consider these data to be charted:



Note that for the Types Article and for Webform, there is no row with Published = No (that is, there are no unpublished nodes for these types). So in this scenario we have 2 so called "holes" ... And that's were the trouble start:


Problem 1: a column chart for these data looks like so:



The bar for "Article" (with value 1) is wrong, that bar is actually related to the value 1 for unpublished "Book pages". And the bar for "Book page" (with value 2) should actually be the bar for the 2 unpublished "Basic pages".
Problem 2: a line chart for these data looks like so:



In this case, the line for "unpublished" suffers similar problems. So it doesn't matter what type of chart you're creating, all charts have this issue.


How to solve this problem

Upgrade to the most recent Dev version to start with (which is much better / stable then the current rc1 version). Then apply the patch attached to the issue comment mentioned above, and check if that helps in your case. If it doesn't, know that it is a prereq for sure (without that patch you won't be able to get it to work). Attention: the patch doesn't seem to apply anymore to the most recent dev version. To make it work (again), do not use the above mentioned patch, but instead use the re-rolled patch attached to in Comment nr 31 of Issue nr 2052429.

Here is how the same column chart from above looks like after applying this correction:



And this is its corresponding line chart:



... Which I believe is the chart that exactly matches the tabular data shown above.

Step 2

If upgrading to the most recent dev version and applying the patch is not sufficient, then I'd recommend you to (temporarily) disable that Views Merge Rows module you have enabled. And (temporarily) modify your view to show the values for PASSED and FAILED as 2 separated columns. And then verify if you get the correct results. That way we can verify if this Views Merge Rows module is the culprit (solve support requests is like taking away all possible causes, 1 at a time ...). 

Step 3

If step 2 doesn't help either, then I recommend what's written in the "Bonus tip" of Steps to create charts using the views UI, i.e.:


  You may find it easier to start with a "Table" display and convert it to a chart display after setting up the data. It can be easier to visualize what the result of the chart will be if it's been laid out in a table first.


In other words: before trying to create a chart, make sure the tabular version of it has the correct data displayed.

Step 4

If none of the previous steps helps, then you may want to check the result you get by correcting your view like so:


Create another display in the same view, let's say you name it "Runs Chart (Total)". It should be equal to all the specs of "Runs Chart (Passed)", but without the filter "Content: Test Case Run Status (Passed)". Obviously, it'll reflect the total Runs (both passed and failed). I'd make it a "line chart" (but that's a matter of personal preferences).
Adapt the "Chart settings" of "Runs Chart (Passed)" to have it use  "Runs Chart (Total)" as the parent chart.
Adapt the "Chart settings" of "Runs Chart (Failed)" to have it use  "Runs Chart (Total)" as the parent chart (instead of "Runs Chart (Passed)").


Step 5

If the work around in step 4 helps as a work around, you may want to further refine the chart settings of "Runs Chart (Total)", by using a color for the line chart that matches the background of your chart (like white?). Possibly something similar for any of it settings like "Legend" (like set it to &amp;nbsp;?

Disclosure: I'm a co-maintainer of the Charts module (+ author of its community documentation),
I hope this does not violate the site's policy on self-promotion.