I would like to have a JSON data structure that contains time series data for multiple charts (one or more lines per chart) and have this data bound dynamically to D3 so that I only need to specify the template for a single chart and then D3 handles creating the entire grid of charts for me according to some layout that I specify. When the underlying data structure is updated, series automatically get added or removed from existing charts or whole charts get added or removed.
I've seen this example that describes how to place multiple charts on a single page, but in the example code has to be written separately for each chart, whereas I am trying to create multiple charts dynamically.
Related
I'd essentially want to create what's in the link in QuickBase, but from what I've seen, it isn't a straightforward procedure.
https://www.exceldashboardtemplates.com/wp-content/uploads/2013/08/image_thumb11.png
Don't think you can use display both value using the native/built-in charts. You could build a Code Page in Quickbase that queries data using the API and then renders a chart using a library such a Highcharts or Charts.js
I have two tables, one that shows the sales history of salespeople per year, and another table that shows the sales history in months. As you can see in the image below:
I need to create a composite chart (I believe it is a composite chart, as it will have more than 01 line) that is exactly the representation of the month table.
After creating the chart when I click on the seller Miguel for example, the chart will be rendered with the history of that seller.
And for example if I click on month 03 of the graph, the table of sellers will be rendered only with the sales that were made in month 03.
I don't know how to do it, I managed to create a composite chart that presents the same data as the month table, however, I was unable to integrate my chart together with my tables.
Can you tell me how I can do that?
I put the codes I made in JSFiddle, here are the links:
Sales/Month Table: https://jsfiddle.net/bernalvinicius/ejxcfpvz/15/
Month Chart: https://jsfiddle.net/bernalvinicius/kanm158j/17/
Thanks in advance.
Just put all your code in the same file(s), combine your crossfilter instances, and put all the charts in the same chart group (the default), and it should work fine.
The chart group is the second parameter to each chart constructor. If it's not specified, then the chart goes into the default chart group.
When any chart is filtered in a chart group, it will tell all the other charts in that chart group to redraw, and they will pull their new data from their respective crossfilter groups. (Sorry about the naming, a dc.js chart group has nothing to do with a crossfilter group.)
In order to combine your code, I renamed both of the crossfilter instances to cf. Then I added the new fields you are generating to the existing rows, instead of mapping the data:
data.forEach(d =>
Object.assign(d, {
mes: d.Month,
atual: d.Vendas_Ano,
passado: d.Vendas_Ant
})
);
In your table fiddle, you were initializing the table for every row in the data with a data.forEach() which wasn't necessary. That's why it was so slow to load.
Other than that, both fiddles had the same general structure so I just copied and pasted the code from the table fiddle to the composite fiddle, HTML, JS, and CSS.
In the JS I made sure to put the same lines outside and inside the d3.json() callback as before.
It looks like it works?
https://jsfiddle.net/gordonwoodhull/0q1y5ftr/15/
I'm working on a Store app that consists of several charts. I've already developed the charts and have them rendering using the chart control in the various forms.
I have been asked to bring these together in an app that allows the user to scroll left and right through each of the charts.
Every example I have found for using a GridView data binds the content of the GridView to item templates.
What I'm trying to get my head round is how I could please these chart controls directly in to a GridView.
Any help would be greatly appreciated.
Cheers,
Roy
As per my understanding of the question you need to have charts as items in a grid view.
If this is what you want, I have dome this before using charts from 3rd party toolkit.
You need ( may be variable sized) templates with each item having a different template of its own.
You need a items list with data for all the charts.
Then upon runtime you need to assign the template to each item.
My Meteor application is somewhat simple and displays a d3 chart generated with server calculated data stored in a newly inserted mongodb document:
the user fills a simple form and clicks the submit button
the server does some async work and CPU intensive calculation using the form data
a new Calculus document with 2 fields (formData and calculatedResult) is inserted in a mongodb Calculi collection
the SVG chart is updated with the newly calculated data
Despite reading the Meteor parties example which makes use of d3, this tutorial on using d3 and Meteor to generate SVG and this screencast on how to build a reactive data source, I'm getting really confused! I'm getting a hard time properly understanding reactive data sources, templates and dependencies in Meteor.
I can't seem to be able to make the SVG chart updates after a new Calculus document is inserted.
Here's my question: what's a comprehensive, newbie-friendly way to automatically update a d3 generated SVG chart with server-calculated data received after submitting a form that inserts a document in a collection?
You either need to have the user subscribe to changes in the Calculi collection (http://docs.meteor.com/#reactivity), or if you're rendering in a template the user's response you can make and call an update() method that runs your d3 code. This will update your charts in the update portion of the d3 code.
In Salesforce, I create a dashboard and drag a pie chart component on to it. I can then drop almost any report onto the pie chart to serve as its data source. Is it possible to use a class or page to drive the Pie Chart instead of a report?
My attempts so far suggest not. I have an apex:page that is returning a very simple table of data. I can add my entire apex:page with its apex:pageblocktable to my dashboard as an embedded VisualForce Page and the table shows up fine. But it won't let me use the page as the data source for my Pie Chart. My controller class isn't even listed to try using it. Is there some way I can evolve my controller or page to make it a suitable data source for a Pie Chart or any other standard Salesforce dashboard component?
I'm starting to think the only option available to me is to make a page that renders the pie chart for itself (probably using flot) and embed that in the dashboard. I'm willing to go this route, but it sure would save me some time if I could use the standard dashboard components. Any help is appreciated.
If you're wondering why I don't just use a report, it's because I haven't found any that combine leads and contacts in one. I've followed this multi-object apex dummy class pattern to create a custom UnifiedLeadContact class with a handful of common properties from my leads and contacts. My controller runs two queries, one for leads and one for contacts, uses the results to populate a list of new UnifiedLeadContacts and returns it. That is working well to feed my table that functions similar to a lead or contact view but has both leads and contacts in it.
As far as I am aware there is no way to use the output of a VF page as the source of a chart.
But you can create a chart as part of your VF page.
If you have a look at http://www.salesforce.com/us/developer/docs/pages/Content/pages_charting_overview.htm
This will give you the basics on how to feed in the data to a chart ov