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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

metzlerd’s picture

Status: Active » Needs review
FileSize
3.02 KB

Here's a fix that tests well when specifying the legend_entries to be a token replacement coming from the data source.

metzlerd’s picture

Status: Needs review » Fixed

  • metzlerd committed 93bc841 on 7.x-4.x
    #2353571 Legends don't work with grouped data.
    

  • metzlerd committed 93bc841 on 7.x-4.x-features
    #2353571 Legends don't work with grouped data.
    

  • metzlerd committed 93bc841 on 8.x-1.x
    #2353571 Legends don't work with grouped data.
    
MickC’s picture

Hi 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tnaberhaus’s picture

FileSize
94.46 KB

Hi 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

metzlerd’s picture

I 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