668 questions
5
votes
1
answer
68
views
How can I ensure legends take up the full width?
I am trying to customize the behavior of a horizontal legend in Plotly.js for varying viewport widths.
Minimal example:
<head>
<script src="https://cdn.plot.ly/plotly-latest.min.js&...
2
votes
1
answer
74
views
How to reset selection across multiple plots to avoid accumulation?
Ah, and is there any hack or workaround on the latest version to reset the selection? Maybe simulating the double click event on an empty area of the plot. This is what I want to achieve:
I cannot ...
0
votes
1
answer
65
views
How can I make the axis labels of a plotly heatmap contain a number?
When I create a plotly heatmap and set the axis labels, the plot gets destroyed if there is a label that can also be interpreted as a number. See the following example:
<!DOCTYPE html>
<html&...
0
votes
1
answer
44
views
Plotly.d3 is missing in Plotly.js v2.25.2
In older versions of Plotly, we used Plotly.d3 for DOM manipulation and adding custom elements inside charts. After upgrading to v2.25.2, Plotly.d3 is no longer available. This completely breaks code ...
2
votes
1
answer
62
views
Rotate a label in Plotly Treemap with JavaScript
Sometimes there are narrow bricks on treemaps. Plotly decreases the font size of such labels, so you cannot read them. But another way is making these labels horizontal. As far as I understood the ...
0
votes
0
answers
72
views
adding labels on the links of sankey charts using plotly.js
I tried adding labels on the links of my sankey that would show the value of the link. I just tried adding "label" property to the link also in the trace of the sankey chart, but this did ...
2
votes
0
answers
71
views
Plotly js time series graph with overlaying axes - hovermode not showing all data on gridline
I want to create a time series plot in Plotly.js with overlaying x-axes, where the hover tooltip displays data from both axes simultaneously. It is currently only displaying the data from the second ...
2
votes
1
answer
168
views
Tooltip in ShadowDOM not showing
I’m building a custom Sankey widget as a web component. I’m using plotly.js and the plot renders correctly, but hover tooltips don’t appear at all. Does plotly.js currently support hover tooltips for ...
2
votes
1
answer
66
views
Rectangle selector tool across multiple charts in Plotly
I'm trying to select multiple charts under each other with Plotly, in JavaScript. The best I could do so far is to create a stacked chart, but it still does not allow selection of multiple rows.
The ...
1
vote
1
answer
82
views
Allow multiple traces in stacked bar chart against days of the year in y-axis
I have the following code which produces the following output:
Two problems here:
The second trace is showing as line instead of grouped or stacked
bar
I want to show some text inside the each bar ...
1
vote
1
answer
82
views
Horizontal histogram chart - show date on horizontal axis
I found the following Plotly chart on CodePen
<head>
<!-- Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-3.0.1.min.js'></script>
</head>
...
1
vote
1
answer
41
views
Title in the JSON file for a Plotly plot cannot be rendered by react-plotly.js library in a React Web App
In my React Web App, I would like to use "react-plotly.js" library to render a Plotly plot from the JSON file exported from Python.
An example of the JSON file is:
{
"data"...
2
votes
0
answers
45
views
How can i set the Y-Axis of a Rangeslider in Plotly to a fixed Range
I'm working with Plotly in JavaScript and came across an issue related to auto-scaling the Y-axis.
I managed to prevent the main Y-axis from rescaling by using Plotly.relayout, which works well. ...
0
votes
0
answers
51
views
Plotly onRelayout not working on mobile devices
I am developing a Web Application where I am using Plotly to render 3D Charts. Now I want to persist the camera scene and for it I am using onRelayout.
My Current Code:
import Plotly from 'plotly.js';
...
0
votes
0
answers
35
views
How to define contour levels is irregular intervals for a contour plot type “level” - Plotly
i have same problem like this thread https://community.plotly.com/t/custom-contour-levels-for-a-contour-plot
The problem is : Is there a definitive way to plot custom contour levels yet? I’m ...
1
vote
0
answers
37
views
How can I maintain consistent formatting for the axis values in both the actual Plotly.js chart and the downloaded image?
I have provided the code where I am plotting 9 traces using Plotly.js and have
formatted the Y-axis scale by calling formatYAxisScale. However, the formatting is not retained when I download the image....
1
vote
1
answer
103
views
Issue with Hover Functionality on 3D Surface Plot in Plotly version 2.35.2
I am experiencing an issue with the hover functionality on a 3D surface plot created using Plotly.
When I move my mouse over the edges of the graph, it seems like the hover interaction does not extend ...
5
votes
1
answer
401
views
How can I use x0/dx in Plotly for a date-based x axis?
I happen to be using Plotly.js, but I suspect this is generic to Plotly across all platforms.
I'm trying to plot a scatter plot of voting intentions, with trend lines over time. There are relatively ...
2
votes
0
answers
32
views
How to fix overlaying x axis in a plotly.js subplots?
I was trying to create a plot using plotly.js which have 2 subplots arranged in a grid with 8 tracks, 4 in each subplot. All track has separate y axis and shared x axis except one track which also ...
0
votes
0
answers
63
views
Plotly-Resampler Not Resampling on Zoom Events in Flask-React Integration
I am experiencing an issue with the plotly-resampler in my Flask backend, which does not resample data as expected when zoom events are triggered in the React frontend. Despite adding an API endpoint ...
1
vote
1
answer
30
views
PlotlyJS 'scatter3D' not working outside ng serve
I basically have two Plotly-charts, one 'scattergl' and one 'scatter3d'.
If I am using ng serve everything works fine and both charts are shown perfectly. The trouble begins if I use ng build and ...
0
votes
0
answers
30
views
How can i display custom tooltip in Plotly.js and append traces with the same value if any, in a single tooltip
I have a Plotly graph with multiple traces which includes line as well as bar plots. If 2 traces have the same value at a point, the tooltip displays only the value of a single trace. I attempted to ...
1
vote
1
answer
695
views
How to update a Plotly graph's data with HTMX keeping the current view state (zoom/pan/etc...)
I use FastAPI for a Python backend and Plotly to generate a plot from some data. On the client side I use HTMX.
The server sends directly the Plot's HTML using Figure.to_html( full_html = False) and ...
0
votes
1
answer
35
views
What colour notations does Plotly.js support?
I'm trying to plot a bar chart, with bars of a specific colour, using Plotly 1.47.4:
Plotly.newPlot(plotElement,
[{
type: "bar",
x: [&...
0
votes
1
answer
62
views
How to maintain the continuity in connecter lines for zero values in a Plotly.js Waterfall Chart?
I'm working with a Waterfall chart in Plotly.js and facing an issue where the connecting lines between bars break when any of the values are zero. I want to maintain the continuity of the connecting ...
1
vote
0
answers
21
views
How to delete white separator or border from line scatter plotly.js, when there are a lot of points?
I use plotly.js, scatter line graph for horizontal timeline
var trace1 = {
x: [1726046102344, 1726051503518],
y: [0, 0],
mode: "lines",
type: "scatter",
line: {
color:...
0
votes
1
answer
74
views
Add more data to the tooltip on the chart with Plotly
I want to add more data to the tooltip, but it only show %{customdata[0]} ... instead of the value
I used customdata as below, but it not work.
{
"name": "PARAM01_STEP_MEAN",
...
0
votes
1
answer
69
views
Contour plot of boolean data using PlotlyJS in julia
I have an array of boolean data like, e.g.,
z = [true true true
true false true
true true true]
I want to make a contour plot of this data, which in this case should just be a 3x3 grid where the ...
0
votes
1
answer
23
views
How do I make the yaxis ticks extend beyond the values in the chart
Basically all of my charts have values that extend beyond the axis in plotly. This includes line charts and bar charts. I can not find any resource for how to make this work in a logical way.
P.S. I ...
1
vote
1
answer
44
views
How to set backgroundcolor in PlotlyJS barpolar chart?
I've created a PlotlyJS barpolar chart, however, the chart background, where the bars end (the range is somewhat larger than the values in this example) seems to be stuck on white, see image. (...
1
vote
0
answers
103
views
Is there a way to achieve an un_click event for on_click() in plotly similar to how on_selection() uses on_deselect()?
I've written a shiny app to demonstrate what I'm trying to do: https://dave-j-guenther.shinyapps.io/pyshiny_highlight_deselect_issue1/
Plotly appears to allow the use of on_deselect as an exit event ...
2
votes
1
answer
430
views
Slow rendering time | Plotly with Typescript React
I am trying to render a large dataset with plotly. I am plotting a temperature and depth line. When the number of data points is ~100,000 it is unusably slow. However when it has ~85,000 points it ...
1
vote
1
answer
555
views
FastAPI: How to handle Plotly graph click events in a web application?
I am using FastAPI to create a simple web app where I want to render a Plotly graph and record the (x, y) values when the graph is clicked. I am exporting the graph and then trying to set up an event ...
-1
votes
1
answer
61
views
Make first bar in waterfall chart no colour in plotly.js
I have a waterfall chart in plotly.js that I am trying to edit without any luck. The code and data look as such:
Data:
waterfallData = ['115.013205594399636', '-0.400842618817745', '2.291162911190306',...
0
votes
1
answer
28
views
Downloading plotly image file in react native windows
I would like to save an image of a plotly chart to my local hard drive within a react native windows application.
We are currently using plotly within a react-native-webview, not the react-native-...
1
vote
1
answer
541
views
How to have custom marker symbol('[' and ']') in Plotly.js
I'm working on a project that requires graphs. I'm using Plotly with JS.
I want custom symbols '[' or ']' as markers on the graph.
Although i prefer without usage of svg, I'm open to change.
How?
I ...
1
vote
1
answer
191
views
Plotly how to change the range and color of gauge programatically
I want to update the range of the colored steps range of a gauge dynamically.
The gauge:
var humidityData = [
{
domain: { x: [0, 1], y: [0, 1] },
value: 0,
title: { text: "...
2
votes
1
answer
48
views
Plotly change value of "reference:"
I want to change the value of the "reference" tag off a gauge in my ESP32 code.
The gauge:
var humidityData = [
{
domain: { x: [0, 1], y: [0, 1] },
value: 0,
title: { text: ...
0
votes
1
answer
493
views
How do I introduce and use plotly in vue3
Recently, it is necessary to use plotly.js in vue3 project, but using npm i, it is always suggested that it has not been introduced.
I would like to ask whether there is a complete introduction ...
0
votes
1
answer
99
views
Plotly value on plot being changed using a reference json
I am building a simple stock tracker which includes a volume graph. The volume is in the ranges of 1k +- 100, while the prices are in the range 1440 +- 5. Because of this if I add in the volume ...
0
votes
1
answer
355
views
Python plotly div size in a html
I am using plotly to create plots for my website. However, when I save the plot as html to inject it in the website, the div containing the plot is way larger than the plot itself. See below from the ...
1
vote
2
answers
88
views
Plotly heatmap: center the zoomed zone after zooming on a rectangle
The following code (see Keep square pixels + ability to have any rectangular shape zoom with Plotly.js, with a plot with 2 layers and Zoom on a Plotly heatmap) works to create a Plotly heatmap that:
...
1
vote
1
answer
827
views
Plotly in grafana, avoid clashing plot and legend
I have a grafana dashboard giving my an overview of the electricity usage in my house, from the grid and produced by solar panels. One of the plots is the cumultative production over the day. I made ...
0
votes
1
answer
199
views
How can I make the legend items bigger with react-plotly.js?
I'm using react-plotly.js and I have a graph with some dots with a color and a border. I want the border to be thick, the problem is that it looks bad in the legend, because the legend is so small.
Is ...
1
vote
0
answers
37
views
JS Plotly: Heatmap colours distorted in print
This happens only in print and not in a browser.
This is the browser view:
But in print pdf, it shows up like this:
code is same and even the print preview has the correct values:
what am I doing ...
0
votes
0
answers
38
views
How can lines in Plotly chart be properly color-coded based on Category or Subcategory?
I have a dataframe like this
Category Subcategory Date Value
0 Category A Subcategory A1 01/01/2016 31250
1 Category A Subcategory A1 01/02/2016 32250
2 Category A Subcategory ...
0
votes
1
answer
86
views
how to sync 3d graphs in plotly JS?
I have multiple 3D scatter graphs setup using scenes.
How can I sync the camera when rotating either graph?
MWE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta ...
1
vote
1
answer
134
views
How to remove out of dates with large range in range selector buttons in Plotly.JS?
I have a line plot with date in x-axis. My data is dynamic, so the range of dates always change. Sometimes it’s 1 year, some time 10 years, etc.
I add this code block for arrange x axis:
xaxis: {
...
1
vote
1
answer
88
views
Plotly.js bar add secondary text for x-axis bars
I am trying to implement the following chart
I tried the following:
data: Plotly.Data[] = [
{
type: 'bar',
x: ['GHS 1', 'GHS 2', 'GHS 3', 'GHS 4', 'GHS 5'],
y: [3, 4, 20, 15, 6],...
0
votes
0
answers
247
views
Add more ticks in plotly log scale
I need to add 2, 3, 4, 5, 6, 7, 8, 9.... ticks on the y-axis. My chart is very tall, so I have enough room to do this. How can I do this?
var trace1 = {
x: [7, 8],
y: [1, 10000000000],
type: ...