question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Radar not displaying correctly

See original GitHub issue

Using the below does not produce a valid radar chart, see image beneath code, We have tried everything for last couple of days!

Is there something we are missing?

Also we all other charts are working fine so it isn’t a problem with the setup.

import React from 'react';
import PropTypes from 'prop-types';
import createPlotlyComponent from 'react-plotly.js/factory';
import _Plot from 'plotly.js/dist/plotly-cartesian';

const Plot = createPlotlyComponent(_Plot);

const RadarChart = ({ data, layout }) => (
  <Plot
    data={[
      {
        type: 'scatterpolar',
        r: [39, 28, 8, 7, 28, 39],
        theta: ['A', 'B', 'C', 'D', 'E', 'A'],
        fill: 'toself',
        name: 'Group A',
      },
      {
        type: 'scatterpolar',
        r: [1.5, 10, 39, 31, 15, 1.5],
        theta: ['A', 'B', 'C', 'D', 'E', 'A'],
        fill: 'toself',
        name: 'Group B',
      },
    ]}
    layout={layout}
  />
);

export const radarChartProps = {
  data: PropTypes.arrayOf(PropTypes.array).isRequired,
  layout: PropTypes.object,
};

RadarChart.defaultProps = {
  layout: {
    polar: {
      radialaxis: {
        visible: true,
        range: [0, 50],
      },
    },
    showlegend: false,
  },
};

RadarChart.propTypes = radarChartProps;

export default RadarChart;

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mooncitizencommented, Jan 15, 2019

@nicolaskruchten Hi, thanks for your support here but we actually found the issue we used the import below which got _Plot from plotly.js/dist/plotly-cartesian. When we rebuilt using plotly.js (see code example below) it resolved the issue. However nothing was wrong our end the documentation or code in here “broke” the radar. I leave a code sample incase anyone else in the future runs into this.

codepen : https://codepen.io/mooncitizen/pen/mavYyJ

import PropTypes from 'prop-types';
import createPlotlyComponent from 'react-plotly.js/factory';
import _Plot from 'plotly.js/dist/plotly-cartesian';

import Plotly from 'plotly.js';

const Plot = createPlotlyComponent(Plotly);

const RadarChart = ({ data, layout }) => <Plot data={data} layout={layout} />;

export const radarChartProps = {
  data: PropTypes.arrayOf(PropTypes.array).isRequired,
  layout: PropTypes.object,
};

RadarChart.defaultProps = {
  layout: {
    polar: {
      radialaxis: {
        visible: false,
        range: [0, 50],
      },
    },
    showlegend: false,
  },
};

RadarChart.propTypes = radarChartProps;

export default RadarChart;

0reactions
nicolaskruchtencommented, Jan 16, 2019

OK then, that explains it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Your Radar Detector Not Working? 6 Common Mistakes ...
1. Using a 3rd party power adapter · 2. Trying to use a USB cord for power · 3. Running incorrect settings ·...
Read more >
Having problems with the new NWS radar webpage? Try ...
If you're having problems using the new radar website, here are some alternate links: NWS Weather and Hazards Data Viewer (also can display...
Read more >
Radar Display on Chartplotter is Consistently off but the ...
With the device powered ON, press and hold the ADJ/Menu button. Scroll down and select the Radar tab. Highlight the General tab. Make...
Read more >
My Radar Map Won't Display! - OneLouder Support_English
Follow these steps if you are facing issues with your radar display. First, go to your device settings to applications, to 1Weather, and......
Read more >
Troubleshooting Guide - Radarsign
Think your radar speed sign needs repairs or an upgrade? ... The sign does not display the speeds of some or all of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found