Skip to content

[Bug]: printEchartsConfig not taking into account echartsOptions #3248

@bcapitanu

Description

@bcapitanu

Describe the bug

The documentation on printEchartsConfig setting says:

This includes both any default Evidence config and any echartsOptions you have specified, and so can be useful for debugging.

This doesn't seem to work as described.

Steps to Reproduce

<LineChart
    data={line_chart_data}
    x=dt
    y=value
    y2=rate
    y2SeriesType=bar
    echartsOptions={{
        title: {
            text: 'Foooo'
        },
        xAxis: {
            scale: false
        }
    }}
    printEchartsConfig=true
/>

Following is what the configuration printed showed (note that neither title.text nor xAxis.scale are reflecting the LineChart configuration):

{
   "title": {
      "subtextStyle": {
         "width": "100%"
      }
   },
   "tooltip": {
      "trigger": "axis",
      "show": true,
      "confine": true,
      "axisPointer": {
         "type": "shadow"
      },
      "extraCssText": "box-shadow: 0 3px 6px rgba(0,0,0,.15); box-shadow: 0 2px 4px rgba(0,0,0,.12); z-index: 1; font-feature-settings: \"cv02\", \"tnum\";",
      "order": "valueDesc"
   },
   "legend": {
      "show": true,
      "type": "scroll",
      "top": 0,
      "padding": [
         0,
         0,
         0,
         0
      ],
      "data": [
         "Value",
         "Rate"
      ]
   },
   "grid": {
      "left": "0.8%",
      "right": "3%",
      "bottom": 10,
      "top": 25,
      "containLabel": true
   },
   "xAxis": {
      "type": "time",
      "tooltip": {
         "show": true,
         "position": "inside"
      },
      "splitLine": {
         "show": false
      },
      "axisLine": {
         "show": true
      },
      "axisTick": {
         "show": false
      },
      "axisLabel": {
         "show": true,
         "hideOverlap": true,
         "showMaxLabel": false,
         "formatter": false,
         "margin": 6
      },
      "scale": true,
      "z": 2,
      "boundaryGap": [
         "2%",
         "2%"
      ]
   },
   "yAxis": [
      {
         "type": "value",
         "logBase": 10,
         "splitLine": {
            "show": true
         },
         "axisLine": {
            "show": false,
            "onZero": false
         },
         "axisTick": {
            "show": false
         },
         "axisLabel": {
            "show": true,
            "hideOverlap": true,
            "margin": 4
         },
         "name": "Value",
         "nameLocation": "end",
         "nameTextStyle": {
            "align": "left",
            "verticalAlign": "top",
            "padding": [
               0,
               5,
               0,
               0
            ]
         },
         "nameGap": 6,
         "scale": false,
         "boundaryGap": [
            "0%",
            "1%"
         ],
         "z": 2
      },
      {
         "type": "value",
         "show": true,
         "alignTicks": true,
         "splitLine": {
            "show": true
         },
         "axisLine": {
            "show": false,
            "onZero": false
         },
         "axisTick": {
            "show": false
         },
         "axisLabel": {
            "show": true,
            "hideOverlap": true,
            "margin": 4
         },
         "name": "Rate",
         "nameLocation": "end",
         "nameTextStyle": {
            "align": "right",
            "verticalAlign": "top",
            "padding": [
               0,
               0,
               0,
               5
            ]
         },
         "nameGap": 6,
         "scale": false,
         "boundaryGap": [
            "0%",
            "1%"
         ],
         "z": 2
      }
   ],
   "series": [
      {
         "type": "line",
         "label": {
            "show": false,
            "fontSize": 11,
            "position": "top",
            "padding": 3
         },
         "labelLayout": {
            "hideOverlap": true
         },
         "connectNulls": false,
         "emphasis": {
            "focus": "series",
            "endLabel": {
               "show": false
            },
            "lineStyle": {
               "opacity": 1,
               "width": 3
            }
         },
         "lineStyle": {
            "width": 2,
            "type": "solid"
         },
         "itemStyle": {},
         "showSymbol": false,
         "symbol": "circle",
         "symbolSize": 8,
         "step": false,
         "name": "Value",
         "data": [
            [
               "2025-01-01T00:00:00.000Z",
               17
            ],
            [
               "2025-01-02T00:00:00.000Z",
               83
            ],
            [
               "2025-01-03T00:00:00.000Z",
               42
            ],
            [
               "2025-01-04T00:00:00.000Z",
               96
            ],
            [
               "2025-01-05T00:00:00.000Z",
               29
            ]
         ],
         "yAxisIndex": 0
      },
      {
         "type": "bar",
         "label": {
            "show": false,
            "fontSize": 11,
            "position": "top",
            "padding": 3
         },
         "labelLayout": {
            "hideOverlap": true
         },
         "connectNulls": false,
         "emphasis": {
            "focus": "series",
            "endLabel": {
               "show": false
            },
            "lineStyle": {
               "opacity": 1,
               "width": 3
            }
         },
         "lineStyle": {
            "width": 2,
            "type": "solid"
         },
         "itemStyle": {},
         "showSymbol": false,
         "symbol": "circle",
         "symbolSize": 8,
         "step": false,
         "name": "Rate",
         "data": [
            [
               "2025-01-01T00:00:00.000Z",
               0.17
            ],
            [
               "2025-01-02T00:00:00.000Z",
               0.8300000000000001
            ],
            [
               "2025-01-03T00:00:00.000Z",
               0.42
            ],
            [
               "2025-01-04T00:00:00.000Z",
               0.96
            ],
            [
               "2025-01-05T00:00:00.000Z",
               0.29
            ]
         ],
         "yAxisIndex": 1
      }
   ],
   "animation": true,
   "graphic": {
      "id": "horiz-axis-title",
      "type": "text",
      "style": {
         "text": "",
         "textAlign": "right",
         "fill": "#717171"
      },
      "cursor": "auto",
      "right": "3%",
      "top": null,
      "bottom": "2%"
   },
   "color": [
      "#236aa4",
      "#45a1bf",
      "#a5cdee",
      "#8dacbf",
      "#85c7c6",
      "#d2c6ac",
      "#f4b548",
      "#8f3d56",
      "#71b9f4",
      "#46a485"
   ]
}

Logs

System Info

System:
    OS: macOS 15.7.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 131.53 MB / 32.00 GB
    Shell: 5.9 - /opt/homebrew/bin/zsh
  Binaries:
    Node: 22.17.0 - /Users/capitanu/.nvm/versions/node/v22.17.0/bin/node
    npm: 10.9.2 - /Users/capitanu/.nvm/versions/node/v22.17.0/bin/npm
    pnpm: 10.21.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 142.0.7444.162
    Safari: 26.1
  npmPackages:
    @evidence-dev/bigquery: ^2.0.10 => 2.0.10
    @evidence-dev/component-utilities: ^4.0.10 => 4.0.10
    @evidence-dev/core-components: ^5.3.1 => 5.3.1
    @evidence-dev/csv: ^1.0.14 => 1.0.14
    @evidence-dev/databricks: ^1.0.8 => 1.0.8
    @evidence-dev/duckdb: ^1.0.13 => 1.0.13
    @evidence-dev/evidence: ^40.1.5 => 40.1.5
    @evidence-dev/motherduck: ^1.0.4 => 1.0.4
    @evidence-dev/mssql: ^1.1.2 => 1.1.2
    @evidence-dev/mysql: ^1.1.4 => 1.1.4
    @evidence-dev/postgres: ^1.0.7 => 1.0.8
    @evidence-dev/sdk: ^3.0.10 => 3.0.10
    @evidence-dev/snowflake: ^1.2.2 => 1.2.2
    @evidence-dev/source-javascript: ^0.0.3 => 0.0.3
    @evidence-dev/sqlite: ^2.0.7 => 2.0.7
    @evidence-dev/tailwind: ^3.1.1 => 3.1.1
    @evidence-dev/trino: ^1.0.9 => 1.0.9

Severity

annoyance

Additional Information, or Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingto-reviewEvidence team to review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions