Seek a react-plotly.js event handler example - reactjs

I use React & react-plotly.js component (https://github.com/plotly/react-plotly.js) to plot two charts.
Since these two charts share some of the legend name.(like before and after comparsion charts)
I would like them to response the same double click legend event (double click legend will show only that legend data on charts)
There is document in here: https://github.com/plotly/react-plotly.js/#event-handler-props
But is there any example for me to learn and get started?

Related

How to create multilines legend in Data Studio

In Data Studio my 10 points pie chart is like below:
As you can see there is a navigation arrow in the legend at the top of the pie.
I wonder how can I avoid the navigation by creating the multiline legend? How can I wrap the current single line legend?
Three ways to display all items in the legend; located in the Style Tab of the Pie Chart (added a GIF to elaborate):
Increasing the max lines;
Increasing the width of the Pie Chart;
Reducing the font size of the legend.
EDIT: Multi line Legend (Workaround using a Bar Chart)
How about using the legend from a Bar Chart? Added a GIF to elaborate as well as a few points:
Bar Chart: Use a Dimension and Breakdown Dimension that's the same as the one on the Pie Chart and enable the legend (Top) as well as using 2 lines (no legend for the Pie Chart)
Shape: Add a Shape over the Bar Chart (one that blends in with the background)
Order: Right click on components and select Order from the drop down to change the order of the components (Bar Chart: Send to back; Shape: Send Backwards (behind the Pie Chart); Pie Chart: Bring to Front)
Fine Tuning: Use Shift + Movement for precision placement (to get the shape exactly where you want it)

Dygraphs 2.x legend posittioned off the right of graph

I have been trying to update our code to dygraphs 2.x from 1.1.1, but I have encountered a issue with the legend.
I believe it is related to the way our page is structured. We are also using React so this may also have an impact.
The dygraph is on a tab which is initially hidden until the user clicks a button after selecting various options and data sources to generate a time series line chart.
The legend option set to 'always' seems to push the legend off the right of the graph which is not readable by users.Unless they full screen the browser.
After debugging the source I can see that offsetWidth is being used to position the legend and is returning 0. I can only surmise that because the div the chart is inside is only made visible probably after the chart is drawn is messing the position of the legend.
If I regen the chart while visible the legend appears over top the chart as desired. But if I then hide the chart (by clicking on the other tab) and then show the chart (clicking on it's tab) the legend if off to the right again.
I'm not sure how to workaround this.
Presently I reverted back to 1.1.1 which does not have this issue.
Hope someone can suggest something.

React-native: Pull out a slice of victory pie

I used victory chart to create my chart. And I need to add an event that when I click on one of slices of pie chart, it would be pull out.
By any chance, is it possible?

how do i capture the legend shape in google pie charts using jquery?

I am new to angularjs,i made a donut pie chart using google charts now i want to change the legend shape because default shape is circle but i needed square.
google chart append all code for pie charts on load when page render in browser ,so how can i capture the element for legend shape using jquery and change it from circle to square.The element for legend is really down in hierarchy inside the main div so how its possible.
my html for pie charts:
<div class="chart-container">
<div class="chart-title" style="padding-right:7em;">Total Calls</div>
<div google-chart chart="data"></div>
</div>
you can see in snapshot that how google chart append the pie chart inside my html.Inside svg element there is a g element and that g have some other g elements and first g is for legends.
any guide thanks

Highcharts-ng, making rangeselector appear on load

I am using highcharts-ng (https://github.com/pablojim/highcharts-ng) and can reproduce this issue with one of the examples linked from the readme. Steps to reproduce:
Go here:
http://pablojim.github.io/highcharts-ng/examples/example.html
Scroll down and click the "Highchart/Highstock" button
Scroll back up (the chart should be blank) and from the first Series
heading, select Type: Line. Note the chart will redraw. There should be no Zoom/Date Range options at the top of the chart.
Now drag the horizontal scroll bar (Navigator) at the bottom of the chart and note the Zoom / Date Range options appear
How do I make these appear on page load? Rather than waiting for our visitors to interact with the chart.

Resources