Comments (3)
Hi,
Actually, as an user, I consider this as a feature, that I do use a lot :
A DataTable column label can be changed (with DT.setColumnLabel(columnIndex, label)
, while an ID can't.
So, when using big tables, it's really a plus to be able to change the label, to represent different things dynamically, instead of creating a whole new table with different IDs.
So, for my part, I'm using unspecific column ids when creating my tables, and then, I set the labels according to what I want to show. And I really like the way CHAP is using Labels and not IDs 😉
from chap-links-library.
Fair enough, but it's quite unintuitive (took me ~30 mins to figure out) when the following works for Start, End and Content, but not Group:
$data['cols'] = array( array( 'id' => "start", "type" => "datetime" ), array( 'id' => "end", "type" => "datetime" ), array( 'id' => "content", "type" => "string" ), array( 'id' => "group", ['label' => 'group' IS REQUIRED HERE FOR THIS COLUMN NOT TO BE IGNORED], "type" => "string" ) ); ... var data = new google.visualization.DataTable( <?php echo json_encode( $data ); ?> );
I'd suggest either changing the other columns to work the same way (use label, rather than ID), or fall back to id if label is not specified.
It should at least be mentioned in the documentation.
from chap-links-library.
Thanks Crashthatch, good point. Originally the columns where hard coded (start=0, end=1, content=2, optional group=3), but that changed recently by introducing a second optional column, className.
I have made the usage of columns more flexible now:
- First the timeline tries to read the column ids.
- if not available, it will read the column labels.
- if both id's and column's are undefined, it will use the default columning: start=0, end=1, content=2
I see you generate your DataTable from php. Note that unless you use some specific functionality offered by Google DataTable (client side querying, sorting, filtering), or read your data from a Google SpreadSheet, it may be faster and easier use plain JSON instead of Google DataTable.
from chap-links-library.
Related Issues (20)
- chap links timeline customisation HOT 3
- Start and group after double click HOT 7
- Timeline - Wrong item top position with empty group HOT 3
- Network - How can I fire an event on node/link selection HOT 1
- Timeline - Set custom time with click HOT 2
- Can't scroll vertically when on mobile HOT 1
- (timeline) fix top and group axis left to scroll down with touch - Question HOT 12
- zoomin and zoomout feature not working in chaps link library timeline slider HOT 1
- On executing draw/redraw the slider not rendering after first time calling the draw method of chaps link library timeline. HOT 1
- 1 month offset in timeline HOT 2
- Destroy method for timeline
- Drag and Drop from external events
- Time limit
- Input textbox not working.
- Timeline "isSelected" and "unselectItem" don't work with clusters
- Can't load graphs while running GWT projects, but it runs with JS version
- graph3d.js enhancements HOT 1
- Stacking not always working
- B.C. Dates possible?
- Keep -dump output pristine
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 chap-links-library.