Google Charts Filtered Table populate chart - javascript

Looking at google chart example where a pie chart is displayed based on the results of a filtered google chart table. Essentially, I want the pie chart to be redrawn every time a filter is changed.
The reason is because there doesn't seem to be a way to sum or count the original datatable based on the filter. However, I do know this is possible by taking the filtered google table data.
If someone could point me to a good example, it would be much appreciated.
Thanks,

Related

How to highlight a portion of Google Bar Charts determined by category filter?

I'm wanting to replicate a bar chart done in Power BI using google charts, and one of the features I am attempting to implement is this filter effect as shown by the two pictures I've attached a link to.
Bar Chart Before Filtering
Bar Chart After Filtering
I can add example data in a reply if necessary, but the concept is that the bar chart before shows 100% of data made up of sub categories, and on selecting a category from a drop down menu, the percentage coming from that sub category is highlighted while the rest is made transparent. I've searched through the Google Charts documentation and previous questions however I haven't found any information on how to implement this or if this effect is even possible. The controls included in the API seem to only be able to redraw the chart entirely, not keep the chart and highlight the portion filtered.
I've considered having two charts overlaid on top of each other, with the chart on top changing based on the user category selection and the chart on bottom remaining static, however, I'm not sure if that implementation is optimal or possible. Ideally, I would also be able to replicate this effect on other categorical based charts, such as a pie chart. I'm wondering if anyone has any ideas on a workaround in order to create a similar effect, or some input on whether this effect is even possible using the google charts API and JavaScript/HTML/CSS.

D3.js combining filtering by column value and using brush for zooming

I am new to D3.js and have been following examples on this website:
https://www.d3-graph-gallery.com/line.html
I am specifically trying to include a dropdown to filter by a column value and also include a brush for zooming.
The data I am using is simply country, date and covid_cases and I am trying to have an initial monthly line chart that can be zoomed in, while also having the ability to filter by country.
I have taken the code directly from these examples:
https://www.d3-graph-gallery.com/graph/line_brushZoom.html
https://www.d3-graph-gallery.com/graph/line_filter.html
I successfully altered them to fit my data, but am unable to combine them to enable both interactions.
Does anyone have any advice on how I might do this?

Previous data not clearing in scatter chart in EXTJS 4

I am using scatter and bar chart for same data with pagination logic. While we loading the second page, previous scatter chart data are not clearing.
For example we have 6 records and showing 4 record per page, first 4 records are displayed properly as shown below
In the second page the 2 records are displayed but previous scatter chart data are not clearing properly as shown below.The issue is i am getting 2 column chart data and four scatter chart data. How can i clear the previous scatter chart data before rendering new page.
Or else please advice, is there any way to add circle indicator to a bar chart like the images show above.
This is a bug that has been fixed recently; the fix should appear in the nightly builds soon. I would also recommend asking questions like that in Sencha forums, there is a greater chance of them being answered there.

NVD3 Line Chart with View Finder

Anyone know if there is a way to hide the view finder, while still having the chart display a subset of the data? If I filter the data before sending it to the chart, the chart lines are skewed instead of contiguous.
I'm trying to filter on a date range subset of the data, while keeping the lines contiguous with the entire set of data.
I noticed in the source, on line 362, they filter on !d.disabled. I'm wondering if I can hook into that somehow. Does anyone know the proper usage pattern for this?
The view finder is actually Square's Crossfilter found here [0] if you wanted to browse the source and view more documentation.
However, I would just set the display attribute to none in CSS of the svg containing the crossfilter and be done with it.
[0] http://square.github.io/crossfilter/

Google Charts and real time updates

I'm thinking of using the google charts api, in particular column charts and scatter plots. I want to know that can these charts be updated constantly by data it receives from the server via a websocket.
My understanding is that this data will first be added to a data table and then plotted onto a chart. So if data is being updated in the table will this update the chart in 'real time'.
Another question is I'll also have an instance when the columns cannot be defined straight away but again will be updated by the received data; again can google charts handle this.
Thanks
I do not know about google charts, but recently I discovered Smoothie Charts. It can do real-time(smooth). The only problem is that I does only work in Chrome, Firefox according to this Introducing Smoothie Charts post.
Or maybe highCharts. A real-time example at jsfiddle.
if you have
var data = new google.visualization.DataTable();
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
you can do
data.addRows([2015,10])
chart.draw(data);
and it updates the chart
I made a button that adds data in this JSfiddle:
https://jsfiddle.net/kdn2ojxb/3/

Categories

Resources