I'm creating a piece of Java code to fill data into an excel file. The file is pre-created, inlcuding a pivot chart and some vba code.
Though the java code works, I have some problems getting the pivot chart itself to work. I've included a screenshot with some demodata. There are several Problems I'd like to solve:
- The X-Achis seems to behave like a category-axis, though it is formatted as a date-axis.
Symptoms:
- Dates are not ordered automatically, but only if I order the according column in the pivot-table
- All dates have the same distance, though there is a gap of 1.5 years in the data
- The chartline of cathy has a gap. But i do want the line rendered, even if there are dates without data for cathy
Am I using the wrong chart, did I miss the an important checkbox in the chart options or do I really have to interpolate the data programmatically for every day before filling it into the table?
The last option would be not only be disappointing, but also distort the chart since I want to have the datapoints marked with symbols (like the squares and diamonds on the screenshot)
Any help is appreciated.
Edit
By now this is my solution:
- First of all: pivot charts are great, unless you want to visualize randomly ordered dates
- I'm going to copy the pivot-data via vba into another sheet and use a regular chart
- Gaps in the chartline can be avoided by using a point-diagram (X/Y-data) and selecting "connect datapoints with line" in the Dialog in "datasource > hidden and empty cells" (roughly translated from the german locale)
- The vba-code will be extended to set up the diagram to my needs (adjusting range of input data and so on)
Still I'm kind of disappointed. I would have thought this was a usual usecase.