Error: xAxis missing ) in parenthetical

I'm getting this error on a custom plotly.js gauge that I'm making. nothing seems to be able to stop the error message. The plot works fine otherwise

1 Like

try uploading a screenshot to help out out

thank you

Here it is

image

Data Code

[{  value: {{PercentOnTimeState.value}},
    type: "indicator",
    mode: "gauge+number",
    gauge: {
  bar: { color: 'grey' },
        axis: { range: [null, 1], showticklabels: false },
        steps: [ {range: [0.0, 0.595], color: "#F004"}, {range: [0.595, 0.605], color: "black"}, {range: [0.605, 0.745], color: "#FF04"}, {range: [0.745, 0.755], color: "black"}, {range: [0.755, 1], color: "#0F04"}]
      }, 
    number: { font: { color: 'black' } , valueformat: ".2%"}
}]

Layout Code

{
  "paper_bgcolor": "#0000",
  "title": {
    "text": "<b>Pourcentage à temps<b>",
    "font": {
      "color": "#3D3D3D",
      "size": 16
    }
  },
  "font": {
    "family": "Inter",
    "color": "#979797"
  },
  "showlegend": true,
  "legend": {
    "xanchor": "center",
    "x": 0.45,
    "y": -0.2,
    "orientation": "h"
  },
  "margin": {
    "l": 0,
    "r": 0,
    "t": 24,
    "b": 0,
    "pad": 0
  },
  "hovermode": "closest",
  "hoverlabel": {
    "bgcolor": "#000",
    "bordercolor": "#000",
    "font": {
      "color": "#fff",
      "family": "Inter",
      "size": 12
    }
  },
  "clickmode": "select+event",
  "dragmode": "select",
  "xaxis": {
    "title": {
      "text": "",
      "standoff": 6,
      "font": {
        "size": 12
      }
    },
    "type": "-",
    "tickformat": "",
    "automargin": true,
    "fixedrange": true,
    "gridcolor": "#fff",
    "zerolinecolor": "#fff"
  },
  "yaxis": {
    "title": {
      "text": "",
      "standoff": 6,
      "font": {
        "size": 12
      }
    },
    "type": "linear",
    "tickformat": "",
    "automargin": true,
    "fixedrange": true,
    "zerolinecolor": "#DEDEDE"
  }
}

Hey @oesbroeck! The code you posted seems to be working just fine for me without error:

The one thing that's missing is the exact value of {{PercentOnTimeState.value}} could you maybe post that?

I also wonder if creating a new chart and then copying in the code you have written above removes the error for you as well.

@Kabirdas, Thanks for your time.

It's not just that chart, it's every plotly chart that is not a bar chart, which in my case is 16, and the values in them are integers or decimals derived from SQL queries (thus {{PercentOnTimeState.value}} doesn't have a constant value)

@oesbroeck hmm... and PercentOnTimeState is a temporary state or a transformer? I've tried recreating it using both but still no luck so far... Could you maybe share screenshots of how you're passing values to PercentOnTimeState from your SQL queries?

A temporary state which is set by the on success event handler of the SQL query (this is so I can have a default value shown before the query is done)

Can you switch back to the UI form to see if there are any errors there?

Components store settings that aren't in use and those can sometimes return errors that are otherwise innocuous since those settings aren't being used but still get displayed.