Plotly.js is a high-level, declarative charting library. It ships with 20 chart types, including 3D charts, statistical graphs, and SVG maps. It is built on top of d3.js and stack.gl.
Questions tagged [plotly.js]
632 questions
4
votes
1 answer
To highlight one point in Violin chart PlotlyJS
I am using Violin chart of PlotylyJS library, and it takes an array of elements and plots it on the chart. Is possible if I want to highlight one point with a different color from that array?
Like if my array is
demoViolin = [31.8, 63.5, 65, 59,…

Salomi Edward
- 533
- 4
- 15
4
votes
1 answer
How to trigger zoom in and zoom out in plotly chart using user created on click buttons?
I am building an angular application. In which we need to create on click buttons for zooming in and zooming out for plotly chart. We can zoom in zoom out in plotly chart using buttons on hoverable mode bar but this is not required for our…

Vikram
- 83
- 1
- 6
4
votes
1 answer
Plotly JS line graph has very weird lines
So I have a site where I am doing some data modeling using plotly.js. I am plotting a large number of points (in the thousands). on my backend, I calculate regression equations for the points, and generate coordinates for each x value on the graph.…

wil moskal
- 309
- 1
- 14
4
votes
1 answer
tickformat in Plotly Python
I am trying to format my Plotly Bar Chart x-axis to percentages with 3 decimal points.
import chart_studio.plotly as py #for plotting
import plotly.graph_objs as go
y = ['niner', 'deuce', 'checker']
x = [0.03, -0.05, 0.075]
fig =…

dsugasa
- 663
- 1
- 9
- 26
4
votes
1 answer
Update a plotly.js Plot with new data
I am taking my very first steps with Plotly.js and AJAX. However, I am stuck when it comes to passing the new data to the plot. Although the data is received (as confirmed by console.log()), it destroys the plot when using "Plotly.newPlot(). I can't…

lammy
- 457
- 2
- 5
- 22
4
votes
1 answer
Conditional formatting in Plotly
This question is about how to do conditional formatting in Plotly.
Instances where this might be needed:
Scatter plots where points need to be colored (i.e. rainbow) as a function of 2 variable;
Interactive charts where the coloring depends on the…

Sandu Ursu
- 1,181
- 1
- 18
- 28
4
votes
1 answer
Plotly plot failed to automatically scale inside a modal
I have an issue with Plotly.js and bootstrap.
When inserting a graph within a modal, the plot is not automatically scaled to the modal width even if the plot width is set to 100%, and the plot layout option autosize set to true.
When opening the…

Arnaud
- 157
- 1
- 8
3
votes
1 answer
Keep square pixels + ability to have any rectangular shape zoom with Plotly.js, with a plot with 2 layers
In Zoom on a Plotly heatmap, the accepted answer provides a way to zoom on a heatmap that:
has squared pixels (required)
allows any rectangular-shaped zoom (and not stuck on the heatmap's aspect ratio).
This stops working if we have a Plotly.js…

Basj
- 41,386
- 99
- 383
- 673
3
votes
1 answer
plotly showing time but I only want date
Trying to use plotly js to make a plot of dates, but for some reason it is showing time and date.
How can I remove time from this plot? Thanks!
x = ["2023-02-13", "2023-02-14"];
y = [3, 4];
var trace1 = {
type: "scatter",
mode: "lines",
…

Frank
- 952
- 1
- 9
- 23
3
votes
1 answer
How to reduce space between title and donut chart in plotly js?
My current code:
const donutData = [
{
values: [2, 98],
labels: ['', ''],
sort: false,
marker: {
colors: ['#0099cc', '#535353'],
},
name: '',
hoverinfo: 'none',
textfont: {
size: [16, 1],
color:…

Jantoma21
- 395
- 4
- 10
3
votes
0 answers
The polygon returned from Flattenjs.BooleanOperations.unify doesn't make any sense
I'm using Flattenjs and Plotly to display polygons. The user can draw polygons anywhere with plotly. If the user draws polygons that are overlapping I want the ability to "merge" those polygons and display just one.
Same this request:…

LCIII
- 3,102
- 3
- 26
- 43
3
votes
0 answers
how to have custom quartiles and median for boxplot plotlyjs
I have dynamic data. Based on length of data i.e even or odd. Based on that i need to calculate custom quartiles and median and pass in theplotly js boxplot.
here is what quartile generally does,
Excel QUARTILE.EXC() Function / Wikipedia method 1…

lkce5v0l2g
- 31
- 2
3
votes
0 answers
Parsing json data using d3.js and plotly.js
I am new to JavaScript, and I am trying to build a front-end for my API. I am using Plotly.Js to visualize a map.
This is an example of the data I want to visualize:
{
"wh_loc": [
{
"latitude": 40.728483 ,
…

Omar Goubail
- 35
- 3
3
votes
0 answers
how to access currently lasso or selected points in Plotly in JavaScript
I am making a lasso select or box select tool of this 96 grid
I want to be able to access the currently highlighted wells in Retool via customComponent.model.selectedPoints
The current plotly code is: