Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

css - Javascript plotly border radius how to

Is there an easy way to create a border radius for a plot in plotly module? I have tried this with no luck...

var trace1 = {
    x: time,
    y: scaledData,
    mode: 'lines',
    type: 'scatter'
};

var layout = {
    xaxis: {type: 'date'},
    yaxis: {title: 'Moisture %'},
    width: 320, 
    height: 320, 
    margin: {l: 50, r: 30, b: 50, t: 65, pad: 10},
    paper_bgcolor: '#79ff4d',
    plot_bgcolor: '#c6ffb3',
    borderRadius: '15px',
    title:'Past 24 Hours'
}


return (
    <Plot data={[trace1]}
      layout={layout}
    />
  );

I also tried the css method but I think I am doing something wrong here as well. I tried creating a div of same size and position and wrapping the plot in it. Then putting a radius on the div but it is behind my plot so it does me no good. Not sure how to do the css hack but I would accept this answer as well, although more work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...