Chart attachment in Views Causes Error on parent chart: Data column(s) for axis #1 cannot be of type string

Created on 24 July 2024, 5 months ago

Problem/Motivation

Charts are created fine, but whenever a chart attachment is added the parent chart crashes giving the error: Data column(s) for axis #1 cannot be of type string.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

5.1

Component

Views integration

Created by

๐Ÿ‡ฏ๐Ÿ‡ฒJamaica lduncan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lduncan
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States andileco

    Can you send the database log that shows which line is problematic?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States andileco

    @lduncan - can you ensure that the chart format on your attachment is set for "This chart_extension (override)"? I'm not able to recreate your issue otherwise.

  • ๐Ÿ‡ฏ๐Ÿ‡ฒJamaica lduncan

    @andileco, yes the chart format is set to "This chart_extension (override). Whenever I set the Axis settings to "Use primary Y-axis" the parent chart gives the error "All series on a given axis must be of the same data type." Even though both parent and attachment are filtered show data from the same content type.

    If I set the Axis setting to "Create a secondary axis" that's when I get the error "Data column(s) for axis #1 cannot be of type string." In both settings the chart attachment display is fine.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States andileco

    @lduncan I'm unable to recreate this. Would you be able to record a screenshare or provide more details? What charting library are you using? What version of PHP are you on?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dbdrupal

    I am seeing this as well. I cannot create more than one chart page in a single view. On Drupal 10.3.2. I can always create the initial display as a chart fine and it works great. Every single time I create a 2nd display in the view that is a chart, it works, but when I toggle back to the first display, it gives me the error below. I go up to the Chart settings on that initial display, and see that nothing is chosen for the Label (but it was before I created the 2nd display). I choose the correct value again and save that and the preview for the initial display now works again but then I have an issue with the second display. When I do get an error it shows with a red background in the Content area in the preview: Data column(s) for axis #0 cannot be of type stringร—

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AlokDrupl Bihar

    I am facing the same issue. I am using Drupal 10.3.2 with chart-type columns, and the Label field is set to "No label field."

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States andileco

    @alokdrupl, that might just be a separate issue purely related to the "No label field"; if so, can you create a new ticket?

    @dbdrupal, can you ensure that your Chart format links are italicized, like in the attached image? If they are not, it means your settings on the one display are overriding the settings on the other. To change this, click the "Chart" link and then select "This display only".

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dbdrupal

    That did it @andileco, thanks! Works fine now with multiple displays.

Production build 0.71.5 2024