When using data provided legend entries with crosstab queries, the legend does not properly display and you receive notice errors:
Undefined index legend_entries
This only happens when data is grouped using frx:group on the svg graph.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | forena_legend_issue.png | 94.46 KB | tnaberhaus |
| #1 | legend-2353571-1.patch | 3.02 KB | metzlerd |
Comments
Comment #1
metzlerd commentedHere's a fix that tests well when specifying the legend_entries to be a token replacement coming from the data source.
Comment #2
metzlerd commentedComment #6
MickC commentedHi David,
The patch works but I found that the legend label is missing if the data isn't compete ie if there are any nulls at the beginning of the cross tab.
A workaround would be to do a union query to create 0 values, but maybe you can find a way to ensure the legend will always generate.
Thanks
Comment #8
tnaberhaus commentedHi David,
Is there a solution to the issue of legend entries not appearing in multiline graphs for a series that contain null values mentioned in #6? The data series appears properly on the graph, but leaves a gap in the legend_entries causing the indexing for other entries to be off by one.
I have attached an image that demonstrates the problem. In the image, the yellow line describes the 'Thanksgiving Monarch Counts' dataset but the legend claims that the yellow line is for "Peninsula Point". The data appears in a crosstab table below the graph.
Thanks,
Thomas
Comment #9
metzlerd commentedI was unable to reproduce this problem. I created legend entries for this grouping and it seemed to work as expected. I commited a sample report to the frx sandbox at:
https://www.drupal.org/sandbox/metzlerd/frx
It would help if you could download and enable this sandbox and see if you get similar results at:
yoursite/reports/legend-test