Comments (14)
I will be looking at adding this to Chartkick in the next few weeks. At least a simple version or a start.
Will be using it as part of my GitHub Analytics project:
https://github.com/StephenOTT/GitHub-Analytics
from chartkick.
Okay i have the basic code up and running with chartkick.
The item that will need to be modified in the core code will be the loading the timeline package:
google.load("visualization", "1.0", {"packages": ["corechart", "timeline"]});
Original code covers only the corechart package. But we only want to have to load the timeline package when needed.
@ankane thoughts?
from chartkick.
Okay so biggest problem at the moment is now the precessSeries function
Specifically the loop that "rights" the format. The problem is the second loop that makes the assumption that all data series will only have 2 data columns. Timelines has 3 data columns.
// right format
for (i = 0; i < series.length; i++) {
data = toArr(series[i].data);
r = [];
for (j = 0; j < data.length; j++) {
//console.log(data.length)
key = data[j][0];
key = time ? toDate(key) : toStr(key);
r.push([key, toFloat(data[j][1])]);
}
if (time) {
r.sort(sortByTime);
}
series[i].data = r;
}
for (j = 0; j < data.length; j++) {
//console.log(data.length)
key = data[j][0];
key = time ? toDate(key) : toStr(key);
r.push([key, toFloat(data[j][1])]);
}
So this loop above needs to be rebuilt to accommodate multiple columns
Once rebuilt it will actually make the code much more robust and valuable.
from chartkick.
My thinking is that that this entire "right format" loop should not be included as a default. It should be optional.
For a few reasons:
- Right now every data value is reprocessed on the client side to put into the new array. This means all data is doubled for each chart occurrence.. correct?. This is a memory concern.
- Not everyone may want to sort their data from A to Z.
- This loop makes the assumption that the data is not in the correct format or order for every dataset. This should be an optional processing option.
- It also assumes that every dataset has only 2 data columns. This is a pretty fair assumption because of the CoreCharts package pretty much deals with 2 columns of data (mainly). But in the Timeline example and I am sure others this assumption becomes problematic.
from chartkick.
NegativeValues Function will also need to be adjusted
from chartkick.
@StephenOTT I'm trying to figure out where additional chart types fit into chartkick, like this and sparklines (see #7). As you've seen, adding these additional chart types require a number of changes to the code, and chart types that are exclusive to Google Charts breaks compatibility w/ Highcharts.
from chartkick.
@ankane Ya i have been going over the code for several hours working through some design patterns to see what would be just modified or what has to be rebuilt to accommodate a more diverse structure.
Issue functions I have identified as problematic for future changes are:
- processSeries
- createDataTable
- and a few parts of jsOptionsFuc - biggest issue is the validity of the results that negativeValues function returns in its current state.
from chartkick.
I keep coming back to the the opinion that rejigging some of the code into a more modular Presentation and Data Manipulation would be beneficial for both Google Charts, Highchart and which ever other systems are used in the future.
Data Manipulation is not always needed and while defaults would be beneficial for a typical use case, a lot of the current code in the above functions are logic to determine when or how to modify the structure. If we strip the decision logic but keep manipulation logic and move the choice to activate certain manipulations to the top level for the user to decide with a T/F array or object of "manipulations", this would support people to create all sorts of extensions and additional data manipulations for different situations if needed. It would always support the more complex versions of the charts that usually contain additional structure within the data series.
from chartkick.
Would really like to see support for the Timeline Chart in Chartkick. It's exactly what I need in a current project.
from chartkick.
Same here, really needing timeline functionality.
from chartkick.
+1
from chartkick.
Timelines have arrived in the latest version.
from chartkick.
is it possible to use timelines with highcharts?
from chartkick.
Found this: http://highcharts.uservoice.com/forums/55896-general/suggestions/804783-gantt-chart. Highcharts also has this on their roadmap for an official implementation. We could just use that for now in chartkick to allow for timeline to work
from chartkick.
Related Issues (20)
- Better adding of plugins to Chart.js with Chartkick HOT 9
- Charts stuck at "Loading..." [example included] HOT 4
- CSP compliance breaks when used with Turbo Drive w/ and random nonce generator HOT 3
- Add support for chart.js 4.x HOT 3
- Add combo bar/line charts HOT 3
- Jruby Support HOT 1
- Support for Apex Charts HOT 1
- Add support for limiting the serie to a certain time frame HOT 1
- Support for polar (spiderweb) charts HOT 1
- Demo not rendering correctly in Safari HOT 2
- `createChart` is not fired after Turbo Frame renders the view HOT 9
- Comparisons in Two Date Ranges HOT 1
- Error importing Chartkick object HOT 2
- Provide ES module for JS with default exports HOT 1
- Rails 7 Setup Additional Step Needed HOT 4
- Canvas accessibility options like aria-label HOT 1
- preffix and suffix on column HOT 1
- X-axis is converted to integers even if datapoint contains alphanumeric characters HOT 1
- Some plugins not (fully) working with Chartkick with Importmaps HOT 2
- Conflicts with Action_text from rails and do not displaying in production(Heroku) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartkick.